aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/secure_password.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index 9d891b9ddc..d824a66784 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -57,9 +57,9 @@ module ActiveModel
include InstanceMethodsOnActivation
if options.fetch(:validations, true)
- validates_confirmation_of :password, if: :should_confirm_password?
+ validates_confirmation_of :password, if: :password_confirmation_required?
validates_presence_of :password, on: :create
- validates_presence_of :password_confirmation, if: :should_confirm_password?
+ validates_presence_of :password_confirmation, if: :password_confirmation_required?
before_create { raise "Password digest missing on new record" if password_digest.blank? }
end
@@ -113,9 +113,9 @@ module ActiveModel
private
- def should_confirm_password?
- password_confirmation && password.present?
- end
+ def password_confirmation_required?
+ password_confirmation && password.present?
+ end
end
end
end