aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-07-08 13:56:07 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-07-08 14:12:27 +0300
commite62e68e25bb7b1281e20e228db66f7deace4330f (patch)
tree68eca51697a69c7aca81553c99deeab87cffd79d /activemodel/CHANGELOG.md
parente8682c5bf051517b0b265e446aa1a7eccfd47bf7 (diff)
downloadrails-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.md8
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*