# Association

**URL:** <https://www.ruby-forum.com/t/association/131136>\
**Category:** Rails\
**Created:** [March 6, 2008, 11:14am UTC](https://www.ruby-forum.com/t/association/131136 "2008-03-06T11:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 6, 2008, 11:14am UTC](https://www.ruby-forum.com/t/association/131136/1 "2008-03-06T11:14:37Z")

</div>

Hi  
I have tables

```
1)sd_impacts
 id integer not null
 name character varying(80)

2)sd_urgencies
  id integer not null
 name character varying(80)

3)sd_priorities
  id integer not null
 name character varying(80)
4)sd_prioritizations
 id integer
 service_desk_impact_id integer
 service_desk_urgency_id integer
 service_desk_priority_id integer

 Here all these tables are master tables.In sd_prioritizations table

```

service\_desk\_impact\_id and service\_desk\_urgency\_id jointly detects  
priority id.  
So in the view 2 select boxes are there for service\_desk\_impact\_id and  
service\_desk\_urgency\_id…Based on which value combination we select, a  
text box displays sd\_priority id .

So what relation should I define in the model SdPrioritization?

Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 6, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/association/131136/2 "2008-03-06T17:37:55Z")

</div>

Sijo Kg wrote:

> service\_desk\_impact\_id and service\_desk\_urgency\_id jointly detects  
> priority id.  
> So in the view 2 select boxes are there for service\_desk\_impact\_id and  
> service\_desk\_urgency\_id…Based on which value combination we select, a  
> text box displays sd\_priority id .
> 
> So what relation should I define in the model SdPrioritization?
> 
> Sijo

Probably this…

class SdPrioritization \< ActiveRecord::Base  
has\_many :sd\_urgencies  
has\_many :sd\_impacts

–  
[http://www.5valleys.com/](http://www.5valleys.com/)  
[http://www.workingwithrails.com/person/8078](http://www.workingwithrails.com/person/8078)
