class DatabaseCleaner::Mongoid::Deletion

Public Class Methods

new(only: [], except: []) click to toggle source
# File lib/database_cleaner/mongoid/deletion.rb, line 9
def initialize only: [], except: []
  @only = only
  @except = except
end

Private Instance Methods

collections_to_delete() click to toggle source
# File lib/database_cleaner/mongoid/deletion.rb, line 22
def collections_to_delete
  only = @only.any? ? @only : collections
  (only - @except).map do |name|
    database[name].find
  end
end