作者suomax (shadow)
看板Ruby
标题[问题] rails find 问题..
时间Tue Jan 16 14:41:23 2007
请问 find 的 :order 选项是否可以与 model 的 relationship 合用?
比如
class Product < ActiveRecord::Base
belongs_to :catalog
end
然後 catalog 有一个顺序值 level
好像不能这样 Product.find(:all, :order => :catalog.level )
有什麽方法达成这样的使用方式吗?
另外这样好像会有大量的资料库存取,还是有比较好的方法呢?@@
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.175.72.248