:select with :include or similar activerecord functionality in rails 2.3
Does anyone开发者_如何学编程 have an elegant way of doing an activerecord call containing a :select AND an :include statement? I have seen a lot of really old information about getting this working in rails 2.3 and I also know that it is functional in rails 3 but unfortunately not in activerecord core as of 2.3. I am using rails 2.3.4 ruby 1.8.7
Parent.find(:all, :select => "foo, bar", :include => :child)
check http://apidock.com/rails/ActiveRecord/Base/find/class for more information.
精彩评论