Skip to content

Commit

Permalink
Avoid using Symbol#to_proc against a refined method
Browse files Browse the repository at this point in the history
because Bullet still supports Ruby 2.3 that does not yet have native
Symbol#to_proc, it calles the Active Support version, and since our
refinements are not in use there, it would cause NoMethodError.
https://github.com/flyerhzm/bullet/actions/runs/9984807517/job/27594646503?pr=709
  • Loading branch information
amatsuda committed Jul 23, 2024
1 parent d2252aa commit 9fecd15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bullet/detector/counter_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def add_possible_objects(object_or_objects)
return unless Bullet.counter_cache_enable?

objects = Array.wrap(object_or_objects)
return if objects.map(&:bullet_primary_key_value).compact.empty?
return if objects.map { |object| object.bullet_primary_key_value }.compact.empty?

Bullet.debug(
'Detector::CounterCache#add_possible_objects',
"objects: #{objects.map(&:bullet_key).join(', ')}"
"objects: #{objects.map{ |object| object.bullet_key }.join(', ')}"
)
objects.each { |object| possible_objects.add object.bullet_key }
end
Expand Down

0 comments on commit 9fecd15

Please sign in to comment.