lib/devise/models/database_authenticatable.rb in devise-1.5.4 vs lib/devise/models/database_authenticatable.rb in devise-2.0.0.rc
- old
+ new
@@ -23,12 +23,10 @@
extend ActiveSupport::Concern
included do
attr_reader :password, :current_password
attr_accessor :password_confirmation
- before_validation :downcase_keys
- before_validation :strip_whitespace
end
# Generates password encryption based on the given value.
def password=(new_password)
@password = new_password
@@ -100,18 +98,9 @@
def authenticatable_salt
self.encrypted_password[0,29] if self.encrypted_password
end
protected
-
- # Downcase case-insensitive keys
- def downcase_keys
- (self.class.case_insensitive_keys || []).each { |k| self[k].try(:downcase!) }
- end
-
- def strip_whitespace
- (self.class.strip_whitespace_keys || []).each { |k| self[k].try(:strip!) }
- end
# Digests the password using bcrypt.
def password_digest(password)
::BCrypt::Password.create("#{password}#{self.class.pepper}", :cost => self.class.stretches).to_s
end