Проще говоря:
pry(main)> User.where(:id =>1).where(:id => 2).first
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
#user 2 is returned
Как я могу заставить его работать:
pry(main)> User.where(:id =>1).where(:id => 2).first
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 AND "users"."id" = 2 LIMIT 1
#this way no user is returned, because I'm narrowing it down as much as possible