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

Fix Typo SecureToken [ci skip]

This commit is contained in:
Roberto Miranda 2015-01-10 16:56:21 -05:00
parent 134abedf19
commit 0f931f2ff0

View file

@ -24,7 +24,7 @@ module ActiveRecord
# validates_presence_of can. You're encouraged to add a unique index in the database to deal with # validates_presence_of can. You're encouraged to add a unique index in the database to deal with
# this even more unlikely scenario. # this even more unlikely scenario.
def has_secure_token(attribute = :token) def has_secure_token(attribute = :token)
# Load securerandom only when has_secure_key is used. # Load securerandom only when has_secure_token is used.
require 'active_support/core_ext/securerandom' require 'active_support/core_ext/securerandom'
define_method("regenerate_#{attribute}") { update! attribute => self.class.generate_unique_secure_token } define_method("regenerate_#{attribute}") { update! attribute => self.class.generate_unique_secure_token }
before_create { self.send("#{attribute}=", self.class.generate_unique_secure_token) } before_create { self.send("#{attribute}=", self.class.generate_unique_secure_token) }