Method: Devise::Models::Lockable::ClassMethods#send_unlock_instructions

Defined in:
lib/devise/models/lockable.rb

#send_unlock_instructions(attributes = {}) ⇒ Object

Attempt to find a user by it’s email. If a record is found, send new unlock instructions to it. If not user is found, returns a new user with an email not found error. Options must contain the user email



131
132
133
134
135
# File 'lib/devise/models/lockable.rb', line 131

def send_unlock_instructions(attributes={})
 lockable = find_or_initialize_with_error_by(:email, attributes[:email], :not_found)
 lockable.resend_unlock_token if lockable.persisted?
 lockable
end