开发者

:select with :include or similar activerecord functionality in rails 2.3

开发者 https://www.devze.com 2023-01-26 02:53 出处:网络
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

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

精彩评论

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

关注公众号