5
我有這個類:Rails中,爲了通過嵌套價值
class Fruit
attr_accessible :name, :position
has_many :apples
default_scope order('position ASC')
end
class Apple
attr_accessible :name
belongs_to :fruit
end
通過fruit.position如何排序的蘋果?