diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-08 13:56:07 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-08 14:12:27 +0300 |
commit | e62e68e25bb7b1281e20e228db66f7deace4330f (patch) | |
tree | 68eca51697a69c7aca81553c99deeab87cffd79d /activemodel/CHANGELOG.md | |
parent | e8682c5bf051517b0b265e446aa1a7eccfd47bf7 (diff) | |
download | rails-e62e68e25bb7b1281e20e228db66f7deace4330f.tar.gz rails-e62e68e25bb7b1281e20e228db66f7deace4330f.tar.bz2 rails-e62e68e25bb7b1281e20e228db66f7deace4330f.zip |
has_secure_password: use `recovery_password` instead of `activation_token`
Since we have `has_secure_token`, it is too confusing to use `_token`
suffix with `has_secure_password`.
Context https://github.com/rails/rails/pull/33307#discussion_r200807185
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r-- | activemodel/CHANGELOG.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index 1a464c2ffd..8f80838a33 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -6,13 +6,13 @@ Example: class User < ActiveRecord::Base - has_secure_password :activation_token, validations: false + has_secure_password :recovery_password, validations: false end user = User.new() - user.activation_token = "a_new_token" - user.activation_token_digest # => "$2a$10$0Budk0Fi/k2CDm2PEwa3Be..." - user.authenticate_activation_token('a_new_token') # => user + user.recovery_password = "42password" + user.recovery_password_digest # => "$2a$04$iOfhwahFymCs5weB3BNH/uX..." + user.authenticate_recovery_password('42password') # => user *Unathi Chonco* |