def delete_all(conditions = nil)
      check_for_limit_scope!

      collection = conditions.nil? ? to_a.each(&:delete).clear : where(conditions)
      collection.map(&:delete).count
    end
def delete_all(conditions = nil)
      check_for_limit_scope!

      collection = conditions.nil? ? to_a.each(&:delete).clear : where(conditions)
      collection.map(&:delete).count
    end
Deletes the records matching +conditions+ by instantiating each
 record and calling its +delete+ method.

 ==== Parameters

 * +conditions+ - A string, array, or hash that specifies which records
   to destroy. If omitted, all records are destroyed.

 ==== Examples

   PersonMock.destroy_all(status: "inactive")
   PersonMock.where(age: 0..18).destroy_all

 If a limit scope is supplied, +delete_all+ raises an ActiveMocker error:

   Post.limit(100).delete_all
   # => ActiveMocker::Error: delete_all doesn't support limit scope