Sha256: 61a9f56fae00dcb60319fcea19c6e442c11ee60dd5be405380d7504482955531

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

module HasGlobalSession
  module Rails
    # Module that is mixed into ActionController's eigenclass; provides access to shared
    # app-wide data such as the configuration object.
    module ActionControllerClassMethods
      def global_session_config
        unless @global_session_config
          config_file = File.join(RAILS_ROOT, 'config', 'global_session.yml')
          @global_session_config = HasGlobalSession::Configuration.new(config_file, RAILS_ENV)
        end

        return @global_session_config
      end

      def global_session_config=(config)
        @global_session_config = config
      end

      def has_global_session
        include HasGlobalSession::Rails::ActionControllerInstanceMethods
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
has_global_session-1.1.3 lib/has_global_session/rails/action_controller_class_methods.rb
has_global_session-1.1.2 lib/has_global_session/rails/action_controller_class_methods.rb