Adds order by properties to group by clause properties #7

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@ybart

Adding order by properties to group by clause properties as required by PostgreSQL.

This happens when referencing an field from a linked table in the order by clause.

Yvan BARTHÉLEMY Adding order by properties to group by clause properties as required …
…by PostgreSQL.

This happens when referencing an field from a linked table in the order by clause.
f4e2f25
@ybart

Here is an example query that enlighten the problem (However, I don't know if using DataMapper::Query::Direction directly is considered legit):

    artist_name = DataMapper::Query::Direction.new(clip.artist.name, direction)
    clip_title = DataMapper::Query::Direction.new(clip.title, direction)

    query = all.query.update(:order => [artist_name, clip_title], 
                             :links => [Clip.relationships['artist'].inverse, relationships['clip'].inverse])
    all(query)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment