-
Notifications
You must be signed in to change notification settings - Fork 235
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
Grouping failing #197
Comments
Check out #100 |
Thank you!! Indeed worked removing the sorting order :) |
I get a similar error, but I have no sorting order on my model. My models are as follows:
I have tried the following, both of which don't work and give me the same error:
and
This is the error I get:
Or
Rails 5.2.0 Thoughts? Edit 1 I also tried the following, after reading #100 :
But that still produces the following error:
Edit 2 For what it's worth, I tried this:
And that worked.....I can't say why though. |
To address my above comment, I actually figured it out which you can see the resolution on Stack Overflow here: https://stackoverflow.com/questions/50243457/how-do-i-get-associations-working-right-with-chartkick/50245478#50245478 |
@marcamillion see #166 |
Hi guys
I've run into a strange error here.
I am trying to do this: Lead.group_by_month(:created_at).count
And get this error (maybe its related to the "timestamptz" parts? I have not noticed that before):
PG::GroupingError: ERROR: column "leads.created_at" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...agen')) AT TIME ZONE 'Europe/Copenhagen' ORDER BY "leads"."c...
^
: SELECT COUNT(*) AS count_all, (DATE_TRUNC('month', (created_at::timestamptz) AT TIME ZONE 'Europe/Copenhagen')) AT TIME ZONE 'Europe/Copenhagen' AS date_trunc_month_created_at_timestamptz_at_time_zone_europe_cop FROM "leads" WHERE (created_at IS NOT NULL) GROUP BY (DATE_TRUNC('month', (created_at::timestamptz) AT TIME ZONE 'Europe/Copenhagen')) AT TIME ZONE 'Europe/Copenhagen' ORDER BY "leads"."created_at" DESC
My setup:
Rails 5.1.5
Groupdate 4.0.1
pg 0.21.0
Postgressql: 9.6
The text was updated successfully, but these errors were encountered: