Skip to content

Instantly share code, notes, and snippets.

@jnjcub
Created September 17, 2018 17:00
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 jnjcub/862c89ef6bf3b5830dab4cfcd60b4b63 to your computer and use it in GitHub Desktop.
Save jnjcub/862c89ef6bf3b5830dab4cfcd60b4b63 to your computer and use it in GitHub Desktop.
Empty Array with IN generate SQL with 1=0
Orion::Api::V1::Event.where(id: [])
Orion::Api::V1::Event Load (36.5ms) SELECT "events".* FROM "events" WHERE "events"."deleted_at" IS NULL AND 1=0
=> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment