lib/rest/change.rb
  Convient update of the dataset by calling sql-patch

  The argument record can be specified as ActiveOrient::Model-instance or as rid-string( #0:0 )
  
  called from ModelRecord#update

  if the update was successful, the updated data are returned as Hash.
Convient update of the dataset by calling sql-patch
The argument record can be specified as ActiveOrient::Model-instance or as rid-string( #0:0 )



if the update was successful, the updated data are returned as Hash.
Convient update of the dataset by calling sql - patch The argument record can be specified as ActiveOrient :: Model - instance or as rid - string ( #0 : 0 ) if the update was successful the updated data are returned as Hash .
def update record, attributes , version=0   
    r = ActiveOrient::Model.autoload_object record.rid 
    return(false) unless r.is_a?(ActiveOrient::Model)
    version = r.version if version.zero?
    result = patch_record(r.rid) do
      attributes.merge({'@version' => version, '@class' => r.class.ref_name })
    end
    if result.is_a?(String)
       JSON.parse(result) 
    else
      logger.error{ "REST::Update was not successfull" }
      logger.error{ "DB-Record #{rrid} is NOT updated "}
       nil   
    end
  end
def update record , attributes , version = 0 r = ActiveOrient :: Model . autoload_object record . rid return ( false ) unless r . is_a? ( ActiveOrient :: Model ) version = r . version if version . zero? result = patch_record ( r . rid ) do attributes . merge ( { '@version' => version , '@class' => r . class . ref_name } ) end if result . is_a? ( String ) JSON . parse ( result ) else logger . error { "REST::Update was not successfull" } logger . error { "DB-Record #{rrid} is NOT updated " } nil end end
Convient update of the dataset by calling sql-patch
The argument record can be specified as ActiveOrient::Model-instance or as rid-string( #0:0 )
Convient update of the dataset by calling sql - patch The argument record can be specified as ActiveOrient :: Model - instance or as rid - string ( #0 : 0 )
# returns a new instance of ActiveOrient::Model and updates any reference on rid # It's assumed, that the version  # if the patch is not successfull no string is returned and thus no record is fetched # JSON.parse(result) if result.is_a?(String) # return value # returnvalue #   ActiveOrient::Model.orientdb_class(name: r.class.ref_name).new(JSON.parse(result))  if result.is_a?(String)
record
<not_specific>
attributes
<not_specific>
version
<not_specific>