activerecord - Rails groupdate gem pg error -
I have a Rail 3.2.14 app where I have the
chartkick and groupdate Code> gem to generate some charts I have installed both gems, and I am trying to do some test questions from the console on my call model. call.group_by_day (: created_at) I take an exception and get the following error:
Call Load (8.8 mms) SELECT "Call". * "Call" WHERE (created_at IS NOT NULL) group by (DATE_TRUNC ('week', (Created: :: Timestamps - Interval '6 days' - Interval '0' hour) Time zone 'America / Chicago') + INTERVAL '6 days' + INTERVAL '0' hours) 'America / Chicago' ActiveRecord :: Statement in Time Zone: Invalid: PG :: Error: Error: The column should appear in the "Call.Id" group BY section or an overall work line 1 Should be used in: SELECT "call" * to "call" WHERE (created_at not tap ... ^: SELECT "call". * "Call" WHERE (created_at IS NOT NULL ) By the group (DATE_TRUNC ('week', (created_at :: timestamptz - INTERVAL '6 days' - INTERVAL '0' hour) Time zone 'America / Chicago') Interval '6 days' + Interval '0' hours) Time America / Chicago in the field? Is there anything that I have to do to do this work? Do I have some scope to do this work? I am new to gems so that anyone Also help will be appreciated.
Obviously I was not calling it < P> I need to call call.group_by_day (: created_at) .count .
Comments
Post a Comment