class ActiveFedora::Relation

def destroy_all(conditions = nil)

Person.where(:age_i => 18).destroy_all
Person.destroy_all(:status_s => "inactive")

==== Examples

more information.
Conditions section in the ActiveFedora::Relation#where for
to destroy. If omitted, all records are destroyed. See the
* +conditions+ - A string, array, or hash that specifies which records

==== Parameters

+delete_all+ instead.
rows quickly, without concern for their associations or callbacks, use
possibly more, to enforce your callbacks). If you want to delete many
once. It generates at least one fedora +DELETE+ query per record (or
record can be time consuming when you're removing many records at
Note: Instantiation, callback execution, and deletion of each

persisted).
reflect that no changes should be made (since they can't be
collection of objects that were destroyed; each will be frozen, to
+before_destroy+/+after_destroy+ Observer methods). Returns the
executed (including :dependent association options and
record and calling its +destroy+ method. Each object's callbacks are
Destroys the records matching +conditions+ by instantiating each
def destroy_all(conditions = nil)
  if conditions
    where(conditions).destroy_all
  else
    to_a.each {|object| object.destroy }.tap { reset }.size
  end
end