Skip to content

Commit e5379fc

Browse files
committed
Fix token references need to be symbols
1 parent e143d25 commit e5379fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activemodel/lib/active_model/secure_password.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ def has_secure_password(attribute = :password, validations: true, reset_token: t
167167
class_eval <<-RUBY, __FILE__, __LINE__ + 1
168168
silence_redefinition_of_method :find_by_#{attribute}_reset_token
169169
def self.find_by_#{attribute}_reset_token(token)
170-
find_by_token_for("#{attribute}_reset", token)
170+
find_by_token_for(:#{attribute}_reset, token)
171171
end
172172
173173
silence_redefinition_of_method :find_by_#{attribute}_reset_token!
174174
def self.find_by_#{attribute}_reset_token!(token)
175-
find_by_token_for!("#{attribute}_reset", token)
175+
find_by_token_for!(:#{attribute}_reset, token)
176176
end
177177
RUBY
178178
end
@@ -222,7 +222,7 @@ def initialize(attribute, reset_token:)
222222
if reset_token
223223
# Returns the class-level configured reset token for the password.
224224
define_method("#{attribute}_reset_token") do
225-
generate_token_for("#{attribute}_reset")
225+
generate_token_for(:"#{attribute}_reset")
226226
end
227227
end
228228
end

0 commit comments

Comments
 (0)