Module: Authlogic::Session::Persistence::InstanceMethods

Defined in:
lib/authlogic/session/persistence.rb

Instance Method Summary collapse

Instance Method Details

#persisting?Boolean

Let’s you know if the session is being persisted or not, meaning the user does not have to explicitly log in in order to be logged in. If the session has no associated record, it will try to find a record and persis the session. This is the method that the class level method find uses to ultimately persist the session.

Returns:

  • (Boolean)


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/authlogic/session/persistence.rb', line 51

def persisting?
  return true if !record.nil?
  self.attempted_record = nil
  before_persisting
  persist
  ensure_authentication_attempted
  if errors.empty? && !attempted_record.nil?
    self.record = attempted_record
    after_persisting
    save_record
    self.new_session = false
    true
  else
    false
  end
end