Sha256: b3b5b5e2e465c83938c0ef70abacae9e92f0fde50bb0636317d6c8918f95bc6a

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

require 'fresh_connection/rack/connection_management'
require 'rails'

module FreshConnection
  class Railtie < Rails::Railtie
    config.fresh_connection = ActiveSupport::OrderedOptions.new
    config.eager_load_namespaces << FreshConnection

    initializer "fresh_connection.configure_rails_initialization" do |app|
      ActiveSupport.on_load(:active_record) do
        app.config.app_middleware.swap(
          ActiveRecord::ConnectionAdapters::ConnectionManagement,
          FreshConnection::Rack::ConnectionManagement
        )

        Initializer.extend_active_record
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fresh_connection-0.2.2 lib/fresh_connection/railtie.rb