Sha256: d4e637d67fadec8e74400310cfb389e659a4ca0e62ec882e20d63a20c5d2d28f

Contents?: true

Size: 785 Bytes

Versions: 8

Compression:

Stored size: 785 Bytes

Contents

module RequestStore
  class Railtie < ::Rails::Railtie
    initializer "request_store.insert_middleware" do |app|
      if ActionDispatch.const_defined? :RequestId
        app.config.middleware.insert_after ActionDispatch::RequestId, RequestStore::Middleware
      else
        app.config.middleware.insert_after Rack::MethodOverride, RequestStore::Middleware
      end

      if ActiveSupport.const_defined?(:Reloader) && ActiveSupport::Reloader.respond_to?(:to_complete)
        ActiveSupport::Reloader.to_complete do
          RequestStore.clear!
        end
      elsif ActionDispatch.const_defined?(:Reloader) && ActionDispatch::Reloader.respond_to?(:to_cleanup)
        ActionDispatch::Reloader.to_cleanup do
          RequestStore.clear!
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/request_store-1.7.0/lib/request_store/railtie.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/request_store-1.7.0/lib/request_store/railtie.rb
request_store-1.7.0 lib/request_store/railtie.rb
request_store-1.4.1 lib/request_store/railtie.rb
request_store-1.4.0 lib/request_store/railtie.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/request_store-1.3.2/lib/request_store/railtie.rb
request_store-1.3.2 lib/request_store/railtie.rb
request_store-1.3.1 lib/request_store/railtie.rb