New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SelectManager#distinct_on to set/unset Arel::Nodes::DistinctOn quantifier #306

Merged
merged 1 commit into from Sep 12, 2014

Conversation

Projects
None yet
3 participants
@mxhold

mxhold commented Aug 30, 2014

This makes it easier to use DISTINCT ON:

table = Arel::Table.new(:users)
table.project(Arel.star).distinct_on(table[:id]).to_sql
# => "SELECT DISTINCT ON ( \"users\".\"id\" ) * FROM \"users\""

Resolves #302

rafaelfranca added a commit that referenced this pull request Sep 12, 2014

Merge pull request #306 from mxhold/master
Add SelectManager#distinct_on to set/unset Arel::Nodes::DistinctOn quantifier

@rafaelfranca rafaelfranca merged commit d23df0e into rails:master Sep 12, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@lbarratt

This comment has been minimized.

lbarratt commented Nov 6, 2014

@mxhold Thankyou so much for this. I just spent hours figuring out what you discovered in #302 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment