lib/bullet.rb in bullet-7.0.4 vs lib/bullet.rb in bullet-7.0.5

- old
+ new

@@ -21,11 +21,15 @@ autoload :NotificationCollector, 'bullet/notification_collector' if defined?(Rails::Railtie) class BulletRailtie < Rails::Railtie initializer 'bullet.configure_rails_initialization' do |app| - app.middleware.use Bullet::Rack + if defined?(ActionDispatch::ContentSecurityPolicy::Middleware) + app.middleware.insert_before ActionDispatch::ContentSecurityPolicy::Middleware, Bullet::Rack + else + app.middleware.use Bullet::Rack + end end end end class << self @@ -142,9 +146,10 @@ Thread.current[:bullet_call_object_associations] = Bullet::Registry::Base.new Thread.current[:bullet_possible_objects] = Bullet::Registry::Object.new Thread.current[:bullet_impossible_objects] = Bullet::Registry::Object.new Thread.current[:bullet_inversed_objects] = Bullet::Registry::Base.new Thread.current[:bullet_eager_loadings] = Bullet::Registry::Association.new + Thread.current[:bullet_call_stacks] = Bullet::Registry::CallStack.new Thread.current[:bullet_counter_possible_objects] ||= Bullet::Registry::Object.new Thread.current[:bullet_counter_impossible_objects] ||= Bullet::Registry::Object.new end