lib/bullet.rb in bullet-5.7.1 vs lib/bullet.rb in bullet-5.7.2
- old
+ new
@@ -40,12 +40,12 @@
def raise=(should_raise)
UniformNotifier.raise = (should_raise ? Notification::UnoptimizedQueryError : false)
end
DETECTORS = [Bullet::Detector::NPlusOneQuery,
- Bullet::Detector::UnusedEagerLoading,
- Bullet::Detector::CounterCache].freeze
+ Bullet::Detector::UnusedEagerLoading,
+ Bullet::Detector::CounterCache].freeze
def enable=(enable)
@enable = @n_plus_one_query_enable = @unused_eager_loading_enable = @counter_cache_enable = enable
if enable?
reset_whitelist
@@ -188,14 +188,13 @@
end
info
end
def warnings
- notification_collector.collection.inject({}) do |warnings, notification|
+ notification_collector.collection.each_with_object({}) do |notification, warnings|
warning_type = notification.class.to_s.split(':').last.tableize
warnings[warning_type] ||= []
warnings[warning_type] << notification
- warnings
end
end
def profile
return_value = nil