lib/sdb/active_sdb.rb
# Reload attributes from SDB. Replaces in-memory attributes.
# 
#  item = Client.find_by_name('Cat')  #=> #<Client:0xb77d0d40 @attributes={"id"=>"2937601a-e45d-11dc-a75f-001bfc466dd7"}, @new_record=false>
#  item.reload                        #=> #<Client:0xb77d0d40 @attributes={"id"=>"2937601a-e45d-11dc-a75f-001bfc466dd7", "name"=>["Cat"], "toys"=>["Jons socks", "clew", "mice"]}, @new_record=false>
#  
Reload attributes from SDB. Replaces in-memory attributes.
Reload attributes from SDB . Replaces in - memory attributes .
def reload
        raise_on_id_absence
        old_id = id
        attrs = connection.get_attributes(domain, id)[:attributes]
        @attributes = {}
        unless attrs.right_blank?
          attrs.each { |attribute, values| @attributes[attribute] = values }
          @attributes['id'] = old_id
        end
        mark_as_old
        @attributes
      end
def reload raise_on_id_absence old_id = id attrs = connection . get_attributes ( domain , id ) [ :attributes ] @attributes = { } unless attrs . right_blank? attrs . each { | attribute , values | @attributes [ attribute ] = values } @attributes [ 'id' ] = old_id end mark_as_old @attributes end
Reload attributes from SDB.
Reload attributes from SDB .