Skip to content

Commit

Permalink
fix count method signature for active_record5
Browse files Browse the repository at this point in the history
- fix also count method signature for active_record5
  • Loading branch information
kaishuu0123 committed Jan 18, 2024
1 parent f063cad commit c673436
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bullet/active_record5.rb
Expand Up @@ -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,
Expand All @@ -284,7 +284,7 @@ def count
proxy_association.reflection.name
)
end
super
super(column_name)
end
end
)
Expand Down

0 comments on commit c673436

Please sign in to comment.