I've found that

Ticket.all(:order => [DataMapper::Query::Direction.new(User.properties
[:name])], :links => [:user])

does exactly what you want from Ticket.all(:order => 'user.name').

On 1 апр, 14:38, Cyril Mougel <cyril.mou...@gmail.com> wrote:
> RLivsey wrote:
> > On Feb 26, 7:03 pm, Cyril Mougel <cyril.mou...@gmail.com> wrote:
>
> >> webr...@yahoo.co.uk wrote:
>
> >>> Could try this..
>
> >>> Ticket.all(:order=> [:title.asc])
>
> >>> Had a bit of trouble with this myself..
>
> >> thisorderworks only toorderby a propertie of Ticket. Not toassociation.
>
> > I'm running into this problem myself at the moment.
>
> > I have the following models:
>
> > class Meeting
> >   has n, :minutes
> > end
>
> > class Minute
> >   belongs_to :meeting
> > end
>
> > I'm trying to get all minutes ordered by a property of the meeting
> > they belong to, so the SQL would be something like:
>
> > SELECT minutes.created_at, meetings.title FROM minutes
> > INNER JOIN meetings ON minutes.meeting_id = meetings.id
> >ORDERBY meetings.start_at ASC, minutes.created_at ASC
>
> > I've tried the following, but get an error for all of them along the
> > lines of:
> > ArgumentError: Unknown property 'meeting.start_at.asc'
>
> > Minute.all(:order=> [:start_at.asc])
> > Minute.all(:order=> ["meeting.start_at.asc"])
> > Minute.all(:order=> ["meeting.start_at asc"])
> > Minute.all(:order=> ["meetings.start_at.asc"])
> > etc...
>
> > Is this possible?
>
> For me not. I have same issue and I check code. but actually nothing is
> possible.
>
> When have time, I want try to integrate it. But now I can't :(
>
> --
> Cyril Mougelhttp://blog.shingara.fr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamapper@googlegroups.com
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to