Class: MinimalistAuthentication::Conversions::MergePasswordHash
- Inherits:
-
Object
- Object
- MinimalistAuthentication::Conversions::MergePasswordHash
- Defined in:
- lib/minimalist_authentication/conversions/merge_password_hash.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user) ⇒ MergePasswordHash
constructor
A new instance of MergePasswordHash.
- #update! ⇒ Object
Constructor Details
#initialize(user) ⇒ MergePasswordHash
Returns a new instance of MergePasswordHash.
23 24 25 |
# File 'lib/minimalist_authentication/conversions/merge_password_hash.rb', line 23 def initialize(user) self.user = user end |
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
19 20 21 |
# File 'lib/minimalist_authentication/conversions/merge_password_hash.rb', line 19 def user @user end |
Class Method Details
.run! ⇒ Object
6 7 8 9 10 |
# File 'lib/minimalist_authentication/conversions/merge_password_hash.rb', line 6 def run! user_model.where(using_digest_version: 3, password_hash: nil).each do |user| new(user).update! end end |
Instance Method Details
#update! ⇒ Object
27 28 29 |
# File 'lib/minimalist_authentication/conversions/merge_password_hash.rb', line 27 def update! user.update_column(:password_hash, merged_password_hash) end |