X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e7c2d2a211e0f5604acc53f4a941067d94d675a9..d07277efba0c0069705bbefa68f2624a9c6c9ff0:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index c0468f8b0..4c7a26473 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -24,12 +24,12 @@ class User < ActiveRecord::Base write_attribute("pass_crypt_confirm", Digest::MD5.hexdigest(str)) end - def self.authenticate(email, passwd) - find_first([ "email = ? AND pass_crypt =?", email, Digest::MD5.hexdigest(passwd) ]) + def self.authenticate(email, passwd) + find(:first, :conditions => [ "email = ? AND pass_crypt = ?", email, Digest::MD5.hexdigest(passwd)]) end def self.authenticate_token(token) - find_first([ "token = ? ", token]) + find(:first, :conditions => [ "token = ? ", token]) end def self.make_token(length=30)