简体   繁体   中英

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

有关更多信息,请参见http://apidock.com/rails/ActiveRecord/Base/find/class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM