Class: Chewy::Railtie::RequestStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/chewy/railtie.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestStrategy

Returns a new instance of RequestStrategy.



8
9
10
# File 'lib/chewy/railtie.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/chewy/railtie.rb', line 12

def call(env)
  if env['PATH_INFO'] =~ /^\/assets\//
    @app.call(env)
  else
    Chewy.strategy(Chewy.request_strategy) { @app.call(env) }
  end
end