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:
parent
134abedf19
commit
0f931f2ff0
1 changed files with 1 additions and 1 deletions
|
@ -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) }
|
||||||
|
|
Loading…
Reference in a new issue