1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

*_digest is defined as a public method

This commit is contained in:
Akira Matsuda 2020-10-26 17:31:06 +09:00
parent b45b9ac05e
commit 98fda672a6

View file

@ -117,7 +117,7 @@ module ActiveModel
# user.authenticate_password('notright') # => false
# user.authenticate_password('mUc3m00RsqyRe') # => user
define_method("authenticate_#{attribute}") do |unencrypted_password|
attribute_digest = send("#{attribute}_digest")
attribute_digest = public_send("#{attribute}_digest")
BCrypt::Password.new(attribute_digest).is_password?(unencrypted_password) && self
end