module Devise::Models::Eventable

Eventable takes care of sending events when common actions are performed in devise.

Options

Examples

Public Instance Methods

fire_events_on_model_update() click to toggle source
# File lib/devise/eventable/models/eventable.rb, line 28
def fire_events_on_model_update
  Devise.fire_event(:password_change, { record: self } ) if saved_change_to_encrypted_password?
  Devise.fire_event(:password_reset_sent, { record: self } ) if saved_change_to_reset_password_token? && !saved_change_to_encrypted_password?
  Devise.fire_event(:password_reset, { record: self } ) if saved_change_to_encrypted_password? && saved_change_to_reset_password_token? && reset_password_token.nil?
  Devise.fire_event(:account_locked, { record: self } ) if saved_change_to_locked_at? && !locked_at.nil?
  Devise.fire_event(:account_unlocked, { record: self } ) if saved_change_to_locked_at? && locked_at.nil?
end