lib/aws-record/record/dirty_tracking.rb
# Fetches attributes for this instance of an item from Amazon DynamoDB 
# using its primary key and the +find(*)+ class method.
#
# @raise [Aws::Record::Errors::NotFound] if no record exists in the 
#  database matching the primary key of the item instance.
# 
# @return [self] Returns the item instance.
Fetches attributes for this instance of an item from Amazon DynamoDB
using its primary key and the +find(*)+ class method.
Fetches attributes for this instance of an item from Amazon DynamoDB using its primary key and the + find ( * ) + class method .
def reload!
        primary_key = self.class.keys.values.inject({}) do |memo, key| 
          memo[key] = send(key)
          memo 
        end
        record = self.class.find(primary_key)
        unless record.nil?
          @data = record.instance_variable_get("@data")
        else
          raise Errors::NotFound.new("No record found")
        end
        clean!
        self
      end
def reload! primary_key = self . class . keys . values . inject ( { } ) do | memo , key | memo [ key ] = send ( key ) memo end record = self . class . find ( primary_key ) unless record . nil? @data = record . instance_variable_get ( "@data" ) else raise Errors :: NotFound . new ( "No record found" ) end clean! self end
Fetches attributes for this instance of an item from Amazon DynamoDB
using its primary key and the +find(*)+ class method.
Fetches attributes for this instance of an item from Amazon DynamoDB using its primary key and the + find ( * ) + class method .
Returns the item instance.
Returns the item instance .
self
[Aws::Record::Errors::NotFound] if no record exists in the database matching the primary key of the item instance.
[ Aws :: Record :: Errors :: NotFound ] if no record exists in the database matching the primary key of the item instance .