[Rails] Modelling question

2010-03-08 Thread Greg Ma
Hi, I have these 3 models: City :name Product :name city_preference :city_id, :product_id, :min, :max How do i create the associations between these tables? Best Greg -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby

Re: [Rails] Modelling question

2010-03-08 Thread Colin Law
On 8 March 2010 21:03, Greg Ma li...@ruby-forum.com wrote: Hi, I have these 3 models: City :name Product :name city_preference :city_id, :product_id, :min, :max How do i create the associations between these tables? Have a look at the rails guide on ActiveRecord Associations at

[Rails] Modelling Question

2010-03-05 Thread Anthony Gardner
Let's say I have the following real life objects Books, Authors, Roles. A Book can have one or many Authors and an Author can have one or many Books. An Author can also have one or many roles associated with a book (maybe they're the author, or co-author, or commentator to whatever) How would you