Class: DeviseCasAuthenticatable::SessionStoreIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/devise_cas_authenticatable/session_store_identifier.rb

Instance Method Summary collapse

Instance Method Details

#current_session_storeObject


4
5
6
7
8
9
10
# File 'lib/devise_cas_authenticatable/session_store_identifier.rb', line 4

def current_session_store
  app = Rails.application.app
  begin
    app = (app.instance_variable_get(:@backend) || app.instance_variable_get(:@app) || app.instance_variable_get(:@target))
  end until app.nil? or app.class == session_store_class
  app
end

#session_store_classObject


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/devise_cas_authenticatable/session_store_identifier.rb', line 12

def session_store_class
  @session_store_class ||=
    begin
      # Rails 3 & 4 session store
      if ::DeviseCasAuthenticatable::SingleSignOut.rails3_or_greater?
        Rails.configuration.session_store
        ::Rails.application.config.session_store
      else
        # => Rails 2
        ActionController::Base.session_store
      end
    rescue NameError => e
      # for older versions of Rails (prior to 2.3)
      ActionController::Base.session_options[:database_manager]
    end
end