ernie/squeel — Issue #93: Strange query generation with devise.
Author: bradphelan
Created: 2012-01-04 22:48:58+00:00
State: open

The below query is ok

ruby-1.9.2-p180 :032 > User.where{encrypted_password=='xxx'}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."encrypted_password" = 'xxx'
=> []

This query is not ok

ruby-1.9.2-p18	0 :033 > User.where{email=='xxx'}
User Load (0.2ms) SELECT "users".* FROM "users"
=> [#]

the email field exists as you can see it is returned but it does not end up in the SQL query.

ActiveRecord standard notation is fine

User.where :email => "xxx"
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'xxx'

Any idea what is up here?

Brad