Skip to content

Commit

Permalink
Disable memoize on string refinement method
Browse files Browse the repository at this point in the history
Its causing all the specs to fail, however I was not able to figure out 
why it was doing so...
  • Loading branch information
vprigent committed Jan 21, 2025
1 parent b10ed99 commit 42d2473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/bullet/detector/n_plus_one_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def add_possible_objects(object_or_objects)
end
obj.bullet_key
end.join(", ")

unless class_names_match_regex || primary_key_values_are_empty
Bullet.debug('Detector::NPlusOneQuery#add_possible_objects', "objects: #{keys_joined}")
objects.each { |object| possible_objects.add object.bullet_key }
Expand Down
8 changes: 2 additions & 6 deletions lib/bullet/ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ module Bullet
module Ext
module String
refine ::String do
attr_reader :bullet_class_name

def bullet_class_name
@bullet_class_name ||= begin
last_colon = self.rindex(':')
last_colon ? self[0...last_colon] : self
end
last_colon = self.rindex(':')
last_colon ? self[0...last_colon].dup : self.dup
end
end
end
Expand Down

0 comments on commit 42d2473

Please sign in to comment.