Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created May 27, 2014 13:02
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 AJFaraday/78e163ca4efc110725c9 to your computer and use it in GitHub Desktop.
Save AJFaraday/78e163ca4efc110725c9 to your computer and use it in GitHub Desktop.
Arel Gotcha!
order_table = Order.arel_table
arel = Order.where(order_table[:id].not_in([]))
sql = arel.to_sql
puts sql
#=> SELECT "ORDERS".* FROM "ORDERS" WHERE ("ORDERS"."ID" NOT IN (NULL))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment