lib/dynamoid/persistence.rb
def update!(conditions = {}, &block)
      run_callbacks(:update) do
        options = range_key ? {:range_key => dump_field(self.read_attribute(range_key), self.class.attributes[range_key])} : {}

        begin
          new_attrs = Dynamoid.adapter.update_item(self.class.table_name, self.hash_key, options.merge(:conditions => conditions)) do |t|
            if(self.class.attributes[:lock_version])
              t.add(lock_version: 1)
            end

            yield t
          end
          load(new_attrs)
        rescue Dynamoid::Errors::ConditionalCheckFailedException
          raise Dynamoid::Errors::StaleObjectError.new(self, 'update')
        end
      end
    end
#
# update!() will increment the lock_version if the table has the column, but will not check it. Thus, a concurrent save will
# never cause an update! to fail, but an update! may cause a concurrent save to fail.
#
#
update!() will increment the lock_version if the table has the column, but will not check it. Thus, a concurrent save will
never cause an update. to fail, but an update. may cause a concurrent save to fail.
update! () will increment the lock_version if the table has the column but will not check it . Thus a concurrent save will never cause an update . to fail but an update . may cause a concurrent save to fail .
def update!(conditions = {}, &block)
      run_callbacks(:update) do
        options = range_key ? {:range_key => dump_field(self.read_attribute(range_key), self.class.attributes[range_key])} : {}
        begin
          new_attrs = Dynamoid.adapter.update_item(self.class.table_name, self.hash_key, options.merge(:conditions => conditions)) do |t|
            if(self.class.attributes[:lock_version])
              t.add(lock_version: 1)
            end
            yield t
          end
          load(new_attrs)
        rescue Dynamoid::Errors::ConditionalCheckFailedException
          raise Dynamoid::Errors::StaleObjectError.new(self, 'update')
        end
      end
    end
def update! ( conditions = { } , & block ) run_callbacks ( :update ) do options = range_key ? { :range_key => dump_field ( self . read_attribute ( range_key ) , self . class . attributes [ range_key ] ) } : { } begin new_attrs = Dynamoid . adapter . update_item ( self . class . table_name , self . hash_key , options . merge ( :conditions => conditions ) ) do | t | if ( self . class . attributes [ :lock_version ] ) t . add ( lock_version : 1 ) end yield t end load ( new_attrs ) rescue Dynamoid :: Errors :: ConditionalCheckFailedException raise Dynamoid :: Errors :: StaleObjectError . new ( self , 'update' ) end end end
update!
update!
conditions
block