class Object

Public Instance Methods

bullet_key() click to toggle source
# File lib/bullet/ext/object.rb, line 4
def bullet_key
  "#{self.class}:#{primary_key_value}"
end
primary_key_value() click to toggle source
# File lib/bullet/ext/object.rb, line 8
def primary_key_value
  if self.class.respond_to?(:primary_keys) && self.class.primary_keys
    self.class.primary_keys.map { |primary_key| send primary_key }.join(','.freeze)
  elsif self.class.respond_to?(:primary_key) && self.class.primary_key
    send self.class.primary_key
  else
    id
  end
end