Sha256: 5f88c33e4a81fa5d965cf5b9157a577d777e14909bd5808f9db7d12377e7c9da

Contents?: true

Size: 627 Bytes

Versions: 5

Compression:

Stored size: 627 Bytes

Contents

require 'fresh_connection/rack/connection_management'

module FreshConnection
  class Railtie < Rails::Railtie
    initializer "fresh_connection.configure_rails_initialization" do |app|
      if defined?(ActiveRecord::ConnectionAdapters::ConnectionManagement)
        app.config.app_middleware.insert_before(
          ActiveRecord::ConnectionAdapters::ConnectionManagement,
          FreshConnection::Rack::ConnectionManagement
        )
      else
        app.config.app_middleware.insert_before(
          ActionDispatch::Executor,
          FreshConnection::Rack::ConnectionManagement
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fresh_connection-2.3.2 lib/fresh_connection/railtie.rb
fresh_connection-2.3.1 lib/fresh_connection/railtie.rb
fresh_connection-2.3.0 lib/fresh_connection/railtie.rb
fresh_connection-2.2.0 lib/fresh_connection/railtie.rb
fresh_connection-2.1.2 lib/fresh_connection/railtie.rb