Module: RackCAS::ActiveRecordStore

Included in:
ActionDispatch::Session::RackCasActiveRecordStore, Rack::Session::RackCASActiveRecordStore
Defined in:
lib/rack-cas/session_store/active_record.rb

Defined Under Namespace

Classes: Session

Class Method Summary collapse

Class Method Details

.destroy_session_by_cas_ticket(cas_ticket) ⇒ Object


6
7
8
9
# File 'lib/rack-cas/session_store/active_record.rb', line 6

def self.destroy_session_by_cas_ticket(cas_ticket)
  affected = Session.where(cas_ticket: cas_ticket).delete_all
  affected == 1
end

.prune(after = nil) ⇒ Object


11
12
13
14
# File 'lib/rack-cas/session_store/active_record.rb', line 11

def self.prune(after = nil)
  after ||= Time.now - 2592000 # 30 days ago
  Session.where('updated_at < ?', after).delete_all
end