aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-01-24 19:57:07 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-01-24 20:06:31 -0800
commit98705d88cd8ec705b80a032f8c166072b4e6fffd (patch)
tree9a525dfdd41d3006d7a3d690d7a4b0aed624df91 /activemodel
parentb6ddbfb15897dbd7f5043f3bfd9c83ffcbe2c2c4 (diff)
downloadrails-98705d88cd8ec705b80a032f8c166072b4e6fffd.tar.gz
rails-98705d88cd8ec705b80a032f8c166072b4e6fffd.tar.bz2
rails-98705d88cd8ec705b80a032f8c166072b4e6fffd.zip
Some minor fixes
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/secure_password.rb4
-rw-r--r--activemodel/test/cases/secure_password_test.rb1
2 files changed, 2 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index c0e60fbb8a..01739d8ae4 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -60,12 +60,12 @@ module ActiveModel
# This ensures the model has a password by checking whether the password_digest
# is present, so that this works with both new and existing records. However,
# when there is an error, the message is added to the password attribute instead
- # so that the error message will makes sense to the end-user.
+ # so that the error message will make sense to the end-user.
validate do |record|
record.errors.add(:password, :blank) unless record.password_digest.present?
end
- validates_confirmation_of :password, if: ->{ self.password.present? }
+ validates_confirmation_of :password, if: ->{ password.present? }
end
if respond_to?(:attributes_protected_by_default)
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb
index 174d18ec8b..82fd291064 100644
--- a/activemodel/test/cases/secure_password_test.rb
+++ b/activemodel/test/cases/secure_password_test.rb
@@ -2,7 +2,6 @@ require 'cases/helper'
require 'models/user'
require 'models/visitor'
-require 'active_support/all'
class SecurePasswordTest < ActiveModel::TestCase
setup do
ActiveModel::SecurePassword.min_cost = true