Sha256: 97cc629445d8a215f5f4f19fe00b7e9d96b978bac5dcb4e6cdd5fa2b3e64735f

Contents?: true

Size: 257 Bytes

Versions: 9

Compression:

Stored size: 257 Bytes

Contents

class Object
  def bullet_key
    "#{self.class}:#{self.primary_key_value}"
  end

  def primary_key_value
    if self.class.respond_to?(:primary_key) && self.class.primary_key
      self.send self.class.primary_key
    else
      self.id
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
bullet_instructure-4.14.8 lib/bullet/ext/object.rb
bullet-4.14.7 lib/bullet/ext/object.rb
bullet_instructure-4.14.7 lib/bullet/ext/object.rb
bullet-4.14.6 lib/bullet/ext/object.rb
bullet-4.14.5 lib/bullet/ext/object.rb
bullet-4.14.4 lib/bullet/ext/object.rb
bullet-4.14.3 lib/bullet/ext/object.rb
bullet-4.14.2 lib/bullet/ext/object.rb
bullet-4.14.0 lib/bullet/ext/object.rb