Sha256: cfccb520260a940770d7d8a94d150df16b7d3ba95dcca33a519845c4aad63f95

Contents?: true

Size: 399 Bytes

Versions: 5

Compression:

Stored size: 399 Bytes

Contents

require 'database_cleaner/truncation_base'

module DatabaseCleaner
  module MongoMapper
    class Truncation < DatabaseCleaner::TruncationBase
      def clean
        connection.db(database).collections.each { |c| c.remove }
      end

      private

      def connection
        ::MongoMapper.connection
      end

      def database
        ::MongoMapper.database.name
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
database_cleaner-0.4.3 lib/database_cleaner/mongo_mapper/truncation.rb
database_cleaner-0.4.2 lib/database_cleaner/mongo_mapper/truncation.rb
tooky-database_cleaner-0.4.1 lib/database_cleaner/mongo_mapper/truncation.rb
database_cleaner-0.4.1 lib/database_cleaner/mongo_mapper/truncation.rb
database_cleaner-0.4.0 lib/database_cleaner/mongo_mapper/truncation.rb