lib/bullet/detector/counter_cache.rb in bullet-5.7.0 vs lib/bullet/detector/counter_cache.rb in bullet-5.7.1
- old
+ new
@@ -30,11 +30,11 @@
Bullet.debug('Detector::CounterCache#add_impossible_object', "object: #{object.bullet_key}")
impossible_objects.add object.bullet_key
end
- def conditions_met?(object, associations)
+ def conditions_met?(object, _associations)
possible_objects.include?(object.bullet_key) && !impossible_objects.include?(object.bullet_key)
end
def possible_objects
Thread.current[:bullet_counter_possible_objects]
@@ -44,17 +44,17 @@
Thread.current[:bullet_counter_impossible_objects]
end
private
- def create_notification(klazz, associations)
- notify_associations = Array(associations) - Bullet.get_whitelist_associations(:counter_cache, klazz)
+ def create_notification(klazz, associations)
+ notify_associations = Array(associations) - Bullet.get_whitelist_associations(:counter_cache, klazz)
- if notify_associations.present?
- notice = Bullet::Notification::CounterCache.new klazz, notify_associations
- Bullet.notification_collector.add notice
- end
+ if notify_associations.present?
+ notice = Bullet::Notification::CounterCache.new klazz, notify_associations
+ Bullet.notification_collector.add notice
end
+ end
end
end
end
end