Sha256: a9f933d2e65e727ba387ca3c467082ee1bcd6ff9e896ecbf03ca5eff29a6ed95

Contents?: true

Size: 475 Bytes

Versions: 7

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

module SuperSettings
  module Context
    # Rack middleware you can use to add a context to your requests so that
    # settings are not changed during request execution.
    #
    # This middleware is automatically added to Rails applications.
    class RackMiddleware
      def initialize(app)
        @app = app
      end

      def call(env)
        SuperSettings.context do
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
super_settings-2.0.3 lib/super_settings/context/rack_middleware.rb
super_settings-2.0.2 lib/super_settings/context/rack_middleware.rb
super_settings-2.0.1 lib/super_settings/context/rack_middleware.rb
super_settings-2.0.0 lib/super_settings/context/rack_middleware.rb
super_settings-1.0.2 lib/super_settings/context/rack_middleware.rb
super_settings-1.0.1 lib/super_settings/context/rack_middleware.rb
super_settings-1.0.0 lib/super_settings/context/rack_middleware.rb