Module: Authlogic::ActsAsAuthentic::SessionMaintenance::Methods

Defined in:
lib/authlogic/acts_as_authentic/session_maintenance.rb

Overview

This module, as one of the `acts_as_authentic_modules`, is only included into an ActiveRecord model if that model calls `acts_as_authentic`.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


88
89
90
91
92
93
# File 'lib/authlogic/acts_as_authentic/session_maintenance.rb', line 88

def self.included(klass)
  klass.class_eval do
    before_save :get_session_information, if: :update_sessions?
    before_save :maintain_sessions, if: :update_sessions?
  end
end

Instance Method Details

#save_without_session_maintenance(**options) ⇒ Object

Save the record and skip session maintenance all together.


96
97
98
99
100
101
# File 'lib/authlogic/acts_as_authentic/session_maintenance.rb', line 96

def save_without_session_maintenance(**options)
  self.skip_session_maintenance = true
  result = save(**options)
  self.skip_session_maintenance = false
  result
end