Skip to content

Instantly share code, notes, and snippets.

@mattpolito
Created December 14, 2010 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpolito/740582 to your computer and use it in GitHub Desktop.
Save mattpolito/740582 to your computer and use it in GitHub Desktop.
Invalid query that changed after upgrade to Rails 3.0.3 from 3.0.1 These seems to be a rouge set of single quotes around the second INNER JOIN
-- Rails 3.0.3 - No workie *Sad Face*
SELECT "presentations".* FROM "presentations" INNER JOIN "taggings" ON "presentations"."id" = "taggings"."taggable_id" AND "taggings"."taggable_type" = 'Presentation' INNER JOIN "tags" ON 'taggings.tag_id = tags.id AND taggings.context = ''tags''' ORDER BY created_at DESC
-- Rails 3.0.1 - Works fine *Hooray*
SELECT "presentations".* FROM "presentations" INNER JOIN "taggings" ON "presentations"."id" = "taggings"."taggable_id" AND "taggings"."taggable_type" = 'Presentation' INNER JOIN "tags" ON taggings.tag_id = tags.id AND taggings.context = 'tags' ORDER BY created_at DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment