Class: Auth::Behavior::RememberMe

Inherits:
Base
  • Object
show all
Defined in:
lib/auth/behavior/remember_me.rb

Defined Under Namespace

Modules: ControllerExtensions Classes: Configuration

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#apply, migration

Instance Method Details

#apply_to_controller(base_controller, user_model) ⇒ Object



6
7
8
# File 'lib/auth/behavior/remember_me.rb', line 6

def apply_to_controller(base_controller, user_model)
  ApplicationController.send(:include, Auth::Behavior::RememberMe::ControllerExtensions)
end

#apply_to_password(password_model, user_model) ⇒ Object



10
11
12
# File 'lib/auth/behavior/remember_me.rb', line 10

def apply_to_password(password_model, user_model)
  # no effect
end

#apply_to_user(user_model) ⇒ Object



14
15
16
17
18
# File 'lib/auth/behavior/remember_me.rb', line 14

def apply_to_user(user_model)
  user_model.auth_config.target.instance_eval do
    has_many :remembrance_tokens, :dependent => :destroy, :as => :authenticatable
  end
end