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 its email. If a record is found, send new password instructions to it. If user is not found, returns a new user with an email not found error. Attributes must contain the user’s email
123 124 125 126 127 |
# File 'lib/devise/models/recoverable.rb', line 123 def send_reset_password_instructions(attributes = {}) recoverable = find_or_initialize_with_errors(reset_password_keys, attributes, :not_found) recoverable.send_reset_password_instructions if recoverable.persisted? recoverable end |