Re: [Rails] include and scopes

2012-01-19 Thread Colin Law
On 30 December 2011 10:54, Damien Knight li...@ruby-forum.com wrote: Hi, I recently changed to rails 3 and the chainability for relations(i.e. .where(xxx).order(xxx)) so here's my question: can i use scopes in my includes to avoid 1+n-query problem? i have: class A ActiveRecord::Base  

[Rails] include and scopes

2011-12-30 Thread Damien Knight
Hi, I recently changed to rails 3 and the chainability for relations(i.e. .where(xxx).order(xxx)) so here's my question: can i use scopes in my includes to avoid 1+n-query problem? i have: class A ActiveRecord::Base has_many :bs end class B ActiveRecord::Base scope :auto, where('auto')