請問 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