Sha256: 9a27ba71454c2696ca05d2507e410226027280b1985ecb2542a2a1d7638ef6de
Contents?: true
Size: 622 Bytes
Versions: 6
Compression:
Stored size: 622 Bytes
Contents
require 'database_cleaner/truncation_base' module DatabaseCleaner module MongoMapper class Truncation < DatabaseCleaner::TruncationBase def clean if @only collections.each { |c| c.remove if @only.include?(c.name) } else collections.each { |c| c.remove unless @tables_to_exclude.include?(c.name) } end true end private def connection ::MongoMapper.connection end def collections connection.db(database).collections end def database ::MongoMapper.database.name end end end end
Version data entries
6 entries across 6 versions & 4 rubygems