Association

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

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.workingwithrails.com/person/8078