Active Record Query Cache

Methods
C
N
Classes and Modules
Class Public methods
new(app)
# File activerecord/lib/active_record/query_cache.rb, line 26
def initialize(app)
  @app = app
end
Instance Public methods
call(env)
# File activerecord/lib/active_record/query_cache.rb, line 58
def call(env)
  old = ActiveRecord::Base.connection.query_cache_enabled
  ActiveRecord::Base.connection.enable_query_cache!

  status, headers, body = @app.call(env)
  [status, headers, BodyProxy.new(old, body)]
rescue Exception => e
  ActiveRecord::Base.connection.clear_query_cache
  unless old
    ActiveRecord::Base.connection.disable_query_cache!
  end
  raise e
end