lib/fresh_connection/railtie.rb in fresh_connection-0.4.0 vs lib/fresh_connection/railtie.rb in fresh_connection-0.4.1

- old
+ new

@@ -1,14 +1,12 @@ require 'fresh_connection/rack/connection_management' module FreshConnection class Railtie < Rails::Railtie 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 - ) - end + app.config.app_middleware.insert_before( + ActiveRecord::ConnectionAdapters::ConnectionManagement, + FreshConnection::Rack::ConnectionManagement + ) end end end