Release v2.1.0 - 2018-06-25
-
Feature - Aws::Record - Add the
persisted?,new_record?, anddestroyed?methods toAws::Record, which supports use cases where you'd like to see if a record has just been newly initialized, or has been deleted or was a preexisting record retrieved from DynamoDB. Note that these methods are present inActiveModel::Modelso you should require that module beforeAws::Record -
Feature - Aws::Record - Add the
assign_attributes,update, andupdate!methods toAws::Recordwhich supports the use case where the user might want to mass assign or update a records attributes by hash.update!also ensures that aValidationErroris thrown on an invalid update -
Upgrading - If you already include
ActiveModel::Modelon your models the newpersisted?,new_record?anddestroyed?methods will not function properly unless you includeActiveModel::ModelbeforeAws::Record. Additionally, new methods could lead to collisions if you happened to have attributes such as:updateor:assign_attributes. In such a case, you would want to version lock below2.1.0, or use the:database_attribute_nameproperty and change your attribute name in code.