Module: Xeroizer::Record::ModelDefinitionHelper::InstanceMethods

Defined in:
lib/xeroizer/record/model_definition_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) id

Returns the value of the Xero primary key for this record if it exists.



87
88
89
# File 'lib/xeroizer/record/model_definition_helper.rb', line 87

def id
  self[self.class.primary_key_name]
end

- (Object) id=(new_id)

Sets the value of the Xero primary key for this record if it exists.



92
93
94
95
# File 'lib/xeroizer/record/model_definition_helper.rb', line 92

def id=(new_id)
  parent.mark_dirty(self) if parent
  self[self.class.primary_key_name] = new_id
end