[Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Jim Burgess
I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company company.rb has_many :items My question: what is the best way to find all of the items belonging to a specific company? If I call Company.items

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company company.rb has_many :items My question: what is the best way to find all

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
On 4 October 2011 21:40, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
Trying again. On 4 October 2011 21:44, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:40, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer,