
Need a way to order by a given count property
Reported by Aadi Deshpande | August 4th, 2008 @ 09:55 AM
Given this heirarchy
class Topic
include DM::Resource
property :id, Integer, :serial => true
property :subject, String
property :body, String
has n, :comments
end
class Comment
include DM::Resource
property :id, Integer, :serial => true
property :body, String
belongs_to :topic
end
I would like to do something like so :
Comment.aggregate( :body.count, :fields => [:topic_id] , :order => [ :body_count ], :limit => 10 )
so that i can order by the count
It seems there's no way currently to do that
It would also be great if there was a way to do generic aliasing of properties in "selection-type" queries such as aggregates ( ones that return an array of field values instead of collections of models )
Comments and changes to this ticket
-
Jonathan Stott (namelessjon) December 12th, 2008 @ 01:13 PM
- Assigned user cleared.
- State changed from new to not-applicable
We've decide that the lighthouse will just be used for tracking bugs, not for feature requests. Please feel free to raise this suggested feature on the mailing list, or work up your own specs and code.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »