But please correct me if i''m wrong: to better conceptualize all the different relationships, think of them as this: has_many_in :your_association has_one_in :your association otherwise, just trying to read '' has_many'' is kinda vague. It could mean ''has_many_of'', and if you think of it like that, your association would then turn into a ''has_one'' instead of many... just imagining an ''in'' at the end of your relationships makes it so much clearer. Insights? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Dominic Son <rails-mailing-list@...> writes:> > > But please correct me if i''m wrong: > to better conceptualize all the different relationships, think of them > as this: > has_many_in :your_association > has_one_in :your association > > otherwise, just trying to read '' has_many'' is kinda vague. It could mean > ''has_many_of'', and if you think of it like that, your association would > then turn into a ''has_one'' instead of many... > > just imagining an ''in'' at the end of your relationships makes it so much > clearer. > > Insights? >class Millionaire < ActiveRecord::Base has_many :houses # has_many_in :houses # doesn''t seem right end class House < ActiveRecord::Base belongs_to :millionaire end Gareth --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> But please correct me if i''m wrong: > to better conceptualize all the different relationships, think of them > as this: > has_many_in :your_association > has_one_in :your associationI may be wrong but I think you''re thinking of the tables rather than the objects the tables represent. Think of how you would describe the relationship between (using Gareth''s example), a Millionaire and his Houses: A millionaire has many houses A house belongs to a millionaire Does that make sense? Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
read up on Entity Relationships and learn to draw an E-R Diagram with cardinality this will help you with the concept On 8/31/06, Stephen Bartholomew <steve-lcUDh2uYFES1Qrn1Bg8BZw@public.gmane.org> wrote:> > > > But please correct me if i''m wrong: > > to better conceptualize all the different relationships, think of them > > as this: > > has_many_in :your_association > > has_one_in :your association > I may be wrong but I think you''re thinking of the tables rather than the > objects the tables represent. > > Think of how you would describe the relationship between (using Gareth''s > example), a Millionaire and his Houses: > > A millionaire has many houses > A house belongs to a millionaire > > Does that make sense? > > Steve > > > >-- www.blogsaic.com search, post, blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Lots of help here guys. I''ve been blasted in the Rails IRC room that i am wrong.. I swear i was on to something! maybe not.. Dion Hewson wrote:> read up on Entity Relationships and learn to draw an E-R Diagram with > cardinality this will help you with the concept > > > > On 8/31/06, Stephen Bartholomew <steve-lcUDh2uYFES1Qrn1Bg8BZw@public.gmane.org> wrote: >> Think of how you would describe the relationship between (using Gareth''s >> > -- > > www.blogsaic.com > search, post, blog-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---