Releases: aws/aws-record-ruby
Release v2.0.0 - 2017-08-29
References: #75
- Upgrading - Aws::Record - Support version 3 of the AWS SDK for Ruby. This is being released as major version 2 of
aws-record
, though the APIs remain the same. Do note, however, that we've changed our SDK dependency to only depend onaws-sdk-dynamodb
. This means that if you were depending on other service clients transitively viaaws-record
, you will need to add dependencies on the appropriate service gems when upgrading.
Release v1.1.1 - 2017-06-16
References: #71
-
Feature - Support lambdas for default attribute values.
date_attr :date, default_value -> { Date.today }
-
Issue - An attribute's default_value could be modified and carried over to
new instances of the model. With this change, default values are deep copied,
and are hydrated at item creation to ensure correct persistence of mutable
objects.
Release v1.1.0 - 2017-04-21
-
Feature - Aws::Record::TableConfig - A declarative way to describe
configuration for your Amazon DynamoDB tables, with smart migrations based on
the current remote state. More details in the documentation. -
Issue - Aws::Record::TableMigration - Legacy table migrations could have
issues with global secondary indexes if a table was deleted and recreated
multiple times.
Release v1.0.3 - 2016-12-19
Release v1.0.2 - 2016-12-02
References: #43
- Issue - Aws::Record::ItemOperations - Fixes an issue where update operations
which consist of onlyREMOVE
expressions failed due to an empty
:expression_attribute_values
map. The fix makes the presence of that map
conditional on the existance of valid values.
Release v1.0.1 - 2016-08-24
Release v1.0.0 - 2016-08-15
- Issue - Aws::Record - Fixes the
#table_exists?
and#provisioned_throughput
methods, which could fail if called before#table_name
.
Release v1.0.0.pre.10 - 2016-08-03
References: #30
- Feature - Aws::Record - Refactored tracking of model attributes, key attributes,
and item data to use internal classes over module composition. Dirty tracking is
also handled more consistently across attributes, and turning on/off of dirty
tracking is only possible at the model level (not for individual attributes).
Release v1.0.0.pre.9 - 2016-07-22
References: #26, #27, #28, #29
-
Feature - Aws::Attribute - Added support for default values at the attribute
level. -
Feature - Aws::Marshalers - Removed the marshalers in the
Aws::Attributes
namespace, replacing them with instantiated marshaler objects. This enables
more functionality in marshalers such as the Date/DateTime marshalers. -
Feature - Aws::Record::DirtyTracking - Improves dirty tracking by adding
support for tracking mutations of attribute value objects. This feature is on
by default for the "collection" types::list_attr
,:map_attr
,
:string_set_attr
, and:numeric_set_attr
.Before this feature, the
#save
method's default behavior of running an
update call for dirty attributes only could cause problems for users of
collection attributes. As many of them are commonly manipulated using mutable
state, the underlying "clean" version of the objects would be modified and the
updated object would not be recognized as dirty, and therefore would not be
updated at all unless explicitly marked as dirty or through a force put.class Model include Aws::Record string_attr :uuid, hash_key: true list_attr :collection end item = Model.new(uuid: SecureRandom.uuid, collection: [1,2,3]) item.clean! # As if loaded from the database, to demonstrate the new tracking. item.dirty? # => false item.collection << 4 # In place mutation of the "collection" array. item.dirty? # => true (Previous versions would not recognize this as dirty. item.save # Would call Aws::DynamoDB::Client#update_item for :collection only.
Note that this feature is implemented using deep copies of collection objects
in memory, so there is a potential memory/performance hit in exchange for the
added accuracy. As such, mutation tracking can be explicitly turned off at the
attribute level or at the full model level, if desired.# Note that the disabling of mutation tracking is redundant in this example, # for illustration purposes. class Model include Aws::Record disable_mutation_tracking # For turning off mutation at the model level. string_attr :uuid, hash_key: true list_attr :collection, mutation_tracking: false # Turn off at attr level. end
Tag release v1.0.0.pre.8
References: #15, #22 * Feature - Aws::Record - Adds the ability to set initial attribute values when calling `#initialize`. Additionally, can call `update` on a model to directly call `Aws::DynamoDB::Client#update_item`.