Class: Devise::Async::Stretch::Backend::Base
- Inherits:
-
Object
- Object
- Devise::Async::Stretch::Backend::Base
- Defined in:
- lib/devise/async/stretch/backend/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#perform(klass, id, password) ⇒ Object
Loads the resource record and sends the email.
Class Method Details
.enqueue_job(*args) ⇒ Object
6 7 8 |
# File 'lib/devise/async/stretch/backend/base.rb', line 6 def self.enqueue_job(*args) raise NotImplementedError, "Any Devise::Async::Stretch::Backend subclass should implement `self.enqueue`." end |
Instance Method Details
#perform(klass, id, password) ⇒ Object
Loads the resource record and sends the email.
It uses orm_adapter API to fetch the record in order to enforce compatibility among diferent ORMs.
14 15 16 17 18 19 |
# File 'lib/devise/async/stretch/backend/base.rb', line 14 def perform(klass, id, password) resource = klass.constantize.to_adapter.get!(id) encrypted_password = resource.bcrypt(password, resource.class.stretches) resource.update(encrypted_password: encrypted_password) end |