Sha256: d5cf4b769bac1fb61976661bb871fe7008766783660628807041c67413756217

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

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

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

    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

4 entries across 4 versions & 1 rubygems

Version Path
fresh_connection-0.2.6 lib/fresh_connection/railtie.rb
fresh_connection-0.2.5 lib/fresh_connection/railtie.rb
fresh_connection-0.2.4 lib/fresh_connection/railtie.rb
fresh_connection-0.2.3 lib/fresh_connection/railtie.rb