lib/bullet/ext/object.rb in bullet-4.10.0 vs lib/bullet/ext/object.rb in bullet-4.11.0
- old
+ new
@@ -1,5 +1,9 @@
class Object
def bullet_ar_key
- "#{self.class}:#{self.id}"
+ if self.is_a? ActiveRecord::Base
+ "#{self.class}:#{self.send self.class.primary_key}"
+ else
+ "#{self.class}:#{self.id}"
+ end
end
end