class N1Finder::Middleware

Middleware that can be used in any rake application to find N+1 queries

Public Class Methods

new(app) click to toggle source
# File lib/n_1_finder/middleware.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source

Wrap app call to `N1Finder.find` method

# File lib/n_1_finder/middleware.rb, line 10
def call(env)
  N1Finder.find { @app.call(env) }
end