-
-
Save AndrewVos/64914529e9936f7ac562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[8] pry(main)> Activity.group(:product_id).order(created_at: :desc) | |
Activity Load (1.1ms) SELECT "activities".* FROM "activities" GROUP BY product_id ORDER BY "activities"."created_at" DESC | |
PG::GroupingError: ERROR: column "activities.id" must appear in the GROUP BY clause or be used in an aggregate function | |
LINE 1: SELECT "activities".* FROM "activities" GROUP BY product_id... | |
^ | |
: SELECT "activities".* FROM "activities" GROUP BY product_id ORDER BY "activities"."created_at" DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment