diff --git a/lib/bullet/active_record5.rb b/lib/bullet/active_record5.rb index c3336bac..22bfff51 100644 --- a/lib/bullet/active_record5.rb +++ b/lib/bullet/active_record5.rb @@ -273,7 +273,7 @@ def count_records ::ActiveRecord::Associations::CollectionProxy.prepend( Module.new do - def count + def count(column_name = nil) if Bullet.start? && !proxy_association.is_a?(::ActiveRecord::Associations::ThroughAssociation) Bullet::Detector::CounterCache.add_counter_cache( proxy_association.owner, @@ -284,7 +284,7 @@ def count proxy_association.reflection.name ) end - super + super(column_name) end end ) diff --git a/lib/bullet/active_record60.rb b/lib/bullet/active_record60.rb index 419adf09..27f1e5de 100644 --- a/lib/bullet/active_record60.rb +++ b/lib/bullet/active_record60.rb @@ -282,7 +282,7 @@ def count_records ::ActiveRecord::Associations::CollectionProxy.prepend( Module.new do - def count + def count(column_name = nil) if Bullet.start? && !proxy_association.is_a?(::ActiveRecord::Associations::ThroughAssociation) Bullet::Detector::CounterCache.add_counter_cache( proxy_association.owner, @@ -293,7 +293,7 @@ def count proxy_association.reflection.name ) end - super + super(column_name) end end )