Displaying 1 result from an estimated 1 matches for "products_by_desc".
2005 Dec 26
2
Dynamic order on has_many relationship?
...nting
to the same table but with different orders and then select which one
I use in the controller instead?
e.g
class Category < AR::B
has_many :products, :order => //something magical?//
end
class Category < AR:B
has_many :products, :order => "product_id"
has_many :products_by_desc, :class_name => "Product", :order =>
"description"
has_many :products_by_gtin, :class_name => "Product", :order => "gtin"
end
If I had a column that was default_order on the Category, could it
evaluate it and set the :order at the model leve...