Skip to content

Commit

Permalink
Merge pull request #700 from kaishuu0123/fix/count-method-signature-f…
Browse files Browse the repository at this point in the history
…or-active_record60

Fix count method signature for active_record5 and active_record60
  • Loading branch information
flyerhzm committed Jan 18, 2024
2 parents f15e7a1 + c673436 commit 6abe9a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
4 changes: 2 additions & 2 deletions lib/bullet/active_record60.rb
Expand Up @@ -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,
Expand All @@ -293,7 +293,7 @@ def count
proxy_association.reflection.name
)
end
super
super(column_name)
end
end
)
Expand Down

0 comments on commit 6abe9a5

Please sign in to comment.