Method: Filemaker::Model::Persistable#update

Defined in:
lib/filemaker/model/persistable.rb

#updateObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/filemaker/model/persistable.rb', line 37

def update
  return false unless valid?
  return true if dirty_attributes.empty?

  run_callbacks :update do
    # Will raise `RecordModificationIdMismatchError` if does not match
    options = { modid: mod_id } # Always pass in?
    yield options if block_given?
    resultset = api.edit(record_id, dirty_attributes, options)
    changes_applied
    replace_new_data(resultset)
  end
  self
end