module ActiveRecord::AttributeMethods::PrimaryKey
def attribute_method?(attr_name)
def attribute_method?(attr_name) attr_name == 'id' || super end
def id
def id if pk = self.class.primary_key sync_with_transaction_state _read_attribute(pk) end end
def id=(value)
def id=(value) sync_with_transaction_state write_attribute(self.class.primary_key, value) if self.class.primary_key end
def id?
def id? sync_with_transaction_state query_attribute(self.class.primary_key) end
def id_before_type_cast
def id_before_type_cast sync_with_transaction_state read_attribute_before_type_cast(self.class.primary_key) end
def id_was
def id_was sync_with_transaction_state attribute_was(self.class.primary_key) end
def to_key
Returns this record's primary key value wrapped in an Array if one is
def to_key sync_with_transaction_state key = self.id [key] if key end