Re: [Rails] Re: Having a problem figuring out how to structure this... Nesting issue

2018-10-25 Thread Colin Law
On Wed, 24 Oct 2018 at 23:21, John Sanderbeck wrote: > One question though... For a through association, I have to have a join > table for the association. > No, if you say Reason has_many :data_entries, :through: :assessment then since you already have reason belongs_to assessment so if you

Re: [Rails] Re: Having a problem figuring out how to structure this... Nesting issue

2018-10-24 Thread John Sanderbeck
One question though... For a through association, I have to have a join table for the association. So since I want Assessment to be my parent, should I do a join like this? Create a data_entry table and a data_records join table and then have the association be assessment has_many

Re: [Rails] Re: Having a problem figuring out how to structure this... Nesting issue

2018-10-24 Thread Colin Law
Certainly you only need to specify the associations you need to use. Colin On Wed, 24 Oct 2018 at 14:44, John Sanderbeck wrote: > > Hmmm... That may work... > > I would always be accessing assessment.data_entries for any lists or views. > Reasons and Consequences are basically select criteria

[Rails] Re: Having a problem figuring out how to structure this... Nesting issue

2018-10-24 Thread John Sanderbeck
Hmmm... That may work... I would always be accessing assessment.data_entries for any lists or views. Reasons and Consequences are basically select criteria for each data entry. I would never reference reason.data_entries or consequence.data_entries a has_many :data_entries, :through: