Module: Devise::Models::PasswordArchivable

Defined in:
lib/devise_security_extension/models/password_archivable.rb

Overview

PasswordArchivable

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



7
8
9
10
11
12
13
14
15
16
# File 'lib/devise_security_extension/models/password_archivable.rb', line 7

def self.included(base) # :nodoc:
  base.extend ClassMethods

  base.class_eval do
    include InstanceMethods
    has_many :old_passwords, :as => :password_archivable, :dependent => :destroy
    before_update :archive_password
    validate :validate_password_archive
  end
end