Skip to content

Commit

Permalink
Merge pull request #1738 from tyabe/fix_admin_template
Browse files Browse the repository at this point in the history
Change email condition for default AR4.1 in minirecord
  • Loading branch information
ujifgc committed Aug 9, 2014
2 parents 0076c25 + 6b2c27d commit 3093f24
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -22,7 +22,7 @@ class <%= @model_name %> < ActiveRecord::Base
# This method is for authentication purpose.
#
def self.authenticate(email, password)
account = first(:conditions => ["lower(email) = lower(?)", email]) if email.present?
account = where("lower(email) = lower(?)", email).first if email.present?
account && account.has_password?(password) ? account : nil
end

Expand Down

0 comments on commit 3093f24

Please sign in to comment.