How to order by property of a belongs_to relationship

11 views
Skip to first unread message

Philipp Kursawe

unread,
Jan 17, 2012, 7:42:42 PM1/17/12
to DataMapper
class License
belongs_to :customer
end

class Customer
has n, :licenses

property company, String
end

How can I order the licenses based on their customer.company value?
License.all(order => [:company.desc]) does not work of course.
Reply all
Reply to author
Forward
0 new messages