attr_encrypted intercepts the attr_encrypted methods, so you must do this:
class User < ActiveRecord::Base attr_encrypted :email, :key => 'a secret key' attr_encrypted :password, :key => 'some other secret key' end User.find_by_email_and_password(' test@example.com ', 'testing')
This is written as
User.find_by_encrypted_email_and_encrypted_password('ENCRYPTED EMAIL', 'ENCRYPTED PASSWORD')
source share