lib/global_session/rails.rb in global_session-3.0.5 vs lib/global_session/rails.rb in global_session-3.1.0
- old
+ new
@@ -45,10 +45,13 @@
# Single Configuration object used by entire Rails app
attr_accessor :configuration
# Single Directory object used by entire Rails app
attr_accessor :directory
+
+ # Single Keystore object used by entire Rails app
+ attr_accessor :keystore
end
def self.activate(rails_config, &block)
config_file = File.join(::Rails.root, 'config', 'global_session.yml')
self.configuration = GlobalSession::Configuration.new(config_file, ::Rails.env)
@@ -66,9 +69,10 @@
"Specified directory class '#{dir_name}' does not inherit from GlobalSession::Directory"
end
authorities_dir = File.join(::Rails.root, 'config', 'authorities')
self.directory = dir_klass.new(self.configuration, authorities_dir)
+ self.keystore = self.directory.keystore
# Add our middleware to the stack.
rails_config.middleware.insert_before(ActionController::Base.session_store, ::Rack::Cookies)
rails_config.middleware.insert_before(ActionController::Base.session_store, ::Rack::GlobalSession,
self.configuration,