Method: Devise::Models::Recoverable::ClassMethods#send_reset_password_instructions
- Defined in:
- lib/devise/models/recoverable.rb
#send_reset_password_instructions(attributes = {}) ⇒ Object
Attempt to find a user by it’s email. If a record is found, send new password instructions to it. If not user is found, returns a new user with an email not found error. Attributes must contain the user email
61 62 63 64 65 |
# File 'lib/devise/models/recoverable.rb', line 61 def send_reset_password_instructions(attributes={}) recoverable = find_or_initialize_with_error_by(:email, attributes[:email], :not_found) recoverable.send_reset_password_instructions unless recoverable.new_record? recoverable end |