lib/bullet/ext/object.rb in bullet-4.11.3 vs lib/bullet/ext/object.rb in bullet-4.12.0
- old
+ new
@@ -1,9 +1,13 @@
class Object
def bullet_key
+ [self.class, self.primary_key_value].join(':')
+ end
+
+ def primary_key_value
if self.class.respond_to?(:primary_key) && self.class.primary_key
- "#{self.class}:#{self.send self.class.primary_key}"
+ self.send self.class.primary_key
else
- "#{self.class}:#{self.id}"
+ self.id
end
end
end