aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-18 01:22:55 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-18 01:23:26 -0500
commitf12244b6d7111ccc5c309d6ce75c5cdb861edc1b (patch)
tree01092d55c20df7ee6a417101e03fa3d9379ba650 /activemodel
parent759e797c1d677d0695885dc959d6ebaecc538252 (diff)
downloadrails-f12244b6d7111ccc5c309d6ce75c5cdb861edc1b.tar.gz
rails-f12244b6d7111ccc5c309d6ce75c5cdb861edc1b.tar.bz2
rails-f12244b6d7111ccc5c309d6ce75c5cdb861edc1b.zip
remove non-breaking spaces [ci skip]
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/secure_password.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index d011402081..4b328b399a 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -44,7 +44,7 @@ module ActiveModel
if options.fetch(:validations, true)
validates_confirmation_of :password
validates_presence_of :password, :on => :create
-
+
before_create { raise "Password digest missing on new record" if password_digest.blank? }
end
@@ -68,7 +68,7 @@ module ActiveModel
# user = User.new(name: 'david', password: 'mUc3m00RsqyRe')
# user.save
# user.authenticate('notright') # => false
- #  user.authenticate('mUc3m00RsqyRe') # => user
+ # user.authenticate('mUc3m00RsqyRe') # => user
def authenticate(unencrypted_password)
BCrypt::Password.new(password_digest) == unencrypted_password && self
end
@@ -84,7 +84,7 @@ module ActiveModel
# user.password = nil
# user.password_digest # => nil
# user.password = 'mUc3m00RsqyRe'
- # user.password_digest # => "$2a$10$4LEA7r4YmNHtvlAvHhsYAeZmk/xeUVtMTYqwIvYY76EW5GUqDiP4."
+ # user.password_digest # => "$2a$10$4LEA7r4YmNHtvlAvHhsYAeZmk/xeUVtMTYqwIvYY76EW5GUqDiP4."
def password=(unencrypted_password)
unless unencrypted_password.blank?
@password = unencrypted_password