lib/dynamoid/criteria/chain.rb
def destroy_all
        ids = []

        if key_present?
          ranges = []
          Dynamoid.adapter.query(source.table_name, range_query).collect do |hash|
            ids << hash[source.hash_key.to_sym]
            ranges << hash[source.range_key.to_sym]
          end

          Dynamoid.adapter.delete(source.table_name, ids,{:range_key => ranges})
        else
          Dynamoid.adapter.scan(source.table_name, query, scan_opts).collect do |hash|
            ids << hash[source.hash_key.to_sym]
          end

          Dynamoid.adapter.delete(source.table_name, ids)
        end
      end
# Destroys all the records matching the criteria.
#
Destroys all the records matching the criteria.
Destroys all the records matching the criteria .
def destroy_all
        ids = []
        if key_present?
          ranges = []
          Dynamoid.adapter.query(source.table_name, range_query).collect do |hash|
            ids << hash[source.hash_key.to_sym]
            ranges << hash[source.range_key.to_sym]
          end
          Dynamoid.adapter.delete(source.table_name, ids,{:range_key => ranges})
        else
          Dynamoid.adapter.scan(source.table_name, query, scan_opts).collect do |hash|
            ids << hash[source.hash_key.to_sym]
          end
          Dynamoid.adapter.delete(source.table_name, ids)
        end
      end
def destroy_all ids = [ ] if key_present? ranges = [ ] Dynamoid . adapter . query ( source . table_name , range_query ) . collect do | hash | ids << hash [ source . hash_key . to_sym ] ranges << hash [ source . range_key . to_sym ] end Dynamoid . adapter . delete ( source . table_name , ids , { :range_key => ranges } ) else Dynamoid . adapter . scan ( source . table_name , query , scan_opts ) . collect do | hash | ids << hash [ source . hash_key . to_sym ] end Dynamoid . adapter . delete ( source . table_name , ids ) end end
Destroys all the records matching the criteria.
Destroys all the records matching the criteria .