class Subserver::Middleware::ActiveRecord

Public Class Methods

new() click to toggle source
# File lib/subserver/middleware/active_record.rb, line 6
def initialize
  # With Rails 5+ we must use the Reloader **always**.
  # The reloader handles code loading and db connection management.
  if defined?(::Rails) && ::Rails::VERSION::MAJOR >= 5
    raise ArgumentError, "Rails 5 no longer needs or uses the ActiveRecord middleware."
  end
end

Public Instance Methods

call(*args) { || ... } click to toggle source
# File lib/subserver/middleware/active_record.rb, line 14
def call(*args)
  yield
ensure
  ::ActiveRecord::ConnectionAdapters::ConnectionHandler.clear_active_connections! 
end