Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ActiveRecord::StatementInvalid (PGError: ERROR: column "recipes.name" must appear in the GROUP BY clause or be used in an aggregate function
- : SELECT recipes.*, sum(c) AS net_votes_and_views FROM "recipes" LEFT JOIN (SELECT
- recipe_id,
- CASE vote WHEN true THEN 1 ELSE -1 END AS c
- FROM
- votes
- WHERE
- vote IS NOT NULL
- AND
- created_at >= '2009-06-13 11:52:45'
- UNION ALL
- SELECT
- recipe_id,
- 1 AS c
- FROM
- recipe_views
- WHERE
- created_at >= '2009-06-13 11:52:45') AS l1 ON l1.recipe_id = recipes.id WHERE (("recipes"."active" = 't')) GROUP BY recipes.id ORDER BY net_votes_and_views DESC, recipes.created_at DESC LIMIT 5 OFFSET 0):
Add Comment
Please, Sign In to add comment