Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Not compatible with Rails 4 count distinct #355

Open
godfat opened this issue Dec 22, 2014 · 1 comment
Open

Not compatible with Rails 4 count distinct #355

godfat opened this issue Dec 22, 2014 · 1 comment

Comments

@godfat
Copy link

godfat commented Dec 22, 2014

Without squeel:

User.select(:username).distinct.count

Generates:

SELECT DISTINCT COUNT(DISTINCT "users"."username") FROM "users"

With squeel:

SELECT DISTINCT COUNT(DISTINCT ) FROM "users"

Which would cause syntax error. Tested with Rails 4.1.8 and pg 0.17.1 (PostgreSQL 9.3.5)

@godfat
Copy link
Author

godfat commented Dec 22, 2014

This caused: charlotte-ruby/impressionist#178

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant