开发者

: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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜