aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/secure_password.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/secure_password.rb')
-rw-r--r--activemodel/lib/active_model/secure_password.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index 7e8370a04c..957d0ddaaa 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -33,12 +33,16 @@ module ActiveModel
attr_reader :password
attr_accessor :password_confirmation
- attr_protected(:password_digest) if respond_to?(:attr_protected)
-
validates_confirmation_of :password
validates_presence_of :password_digest
include InstanceMethodsOnActivation
+
+ if respond_to?(:attributes_protected_by_default)
+ def self.attributes_protected_by_default
+ super + ['password_digest']
+ end
+ end
end
end