lib/ahoy/engine.rb in ahoy_matey-1.5.0 vs lib/ahoy/engine.rb in ahoy_matey-1.5.1
- old
+ new
@@ -1,7 +1,12 @@
module Ahoy
class Engine < ::Rails::Engine
initializer "ahoy.middleware", after: "sprockets.environment" do |app|
+ if Ahoy.throttle
+ require "ahoy/throttle"
+ app.middleware.use Ahoy::Throttle
+ end
+
next unless Ahoy.quiet
# Parse PATH_INFO by assets prefix
AHOY_PREFIX = "/ahoy/".freeze