module Superstore::AttributeMethods::PrimaryKey::AttributeOverrides

Public Instance Methods

attributes() click to toggle source
Calls superclass method
# File lib/superstore/attribute_methods/primary_key.rb, line 29
def attributes
  super.update(self.class.primary_key => id)
end
id() click to toggle source
Calls superclass method
# File lib/superstore/attribute_methods/primary_key.rb, line 20
def id
  value = super
  if value.nil?
    value = self.class._generate_key(self)
    @attributes.write_from_user(self.class.primary_key, value)
  end
  value
end