Skip to content

Commit

Permalink
Fix #has_secure_token documentation [ci skip]
Browse files Browse the repository at this point in the history
It's actually #validates_uniqueness_of that can generate a race condition
rather than #validates_presence_of.
  • Loading branch information
trliner committed Feb 21, 2015
1 parent a60e8ac commit 673653d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/secure_token.rb
Expand Up @@ -21,8 +21,8 @@ module ClassMethods
# SecureRandom::base58 is used to generate the 24-character unique token, so collisions are highly unlikely.
#
# Note that it's still possible to generate a race condition in the database in the same way that
# validates_presence_of can. You're encouraged to add a unique index in the database to deal with
# this even more unlikely scenario.
# <tt>validates_uniqueness_of</tt> can. You're encouraged to add a unique index in the database to deal
# with this even more unlikely scenario.
def has_secure_token(attribute = :token)
# Load securerandom only when has_secure_token is used.
require 'active_support/core_ext/securerandom'
Expand Down

0 comments on commit 673653d

Please sign in to comment.