<commit_before>module DataMapper::Mongo::Spec
  module CleanupModels

    # Cleans up models after a spec by dropping the Mongo collection,
    # removing the model classes from the descendants list, and then
    # undefining the constants.
    #
    # @todo Only used once; try to remove.
    #
    def cleanup_models(*models)
      unless models.empty?
        model = models.pop
        name = model.name

        if model.respond_to?(:storage_name)
          db = DataMapper::Mongo::Spec.database(model.repository.name)
          db.drop_collection(model.storage_name)
        end

        DataMapper::Model.descendants.delete(model)

        if name && Object.const_defined?(name)
          Object.send(:remove_const, name)
        end

        cleanup_models(*models)
      end
    end

  end # CleanupModels
end # DataMaper::Mongo::Spec<commit_msg>Removed database cleaning while cleanup models<commit_after>module DataMapper::Mongo::Spec
  module CleanupModels

    # Cleans up models after a spec by dropping the Mongo collection,
    # removing the model classes from the descendants list, and then
    # undefining the constants.
    #
    # @todo Only used once; try to remove.
    #
    def cleanup_models(*models)
      unless models.empty?
        model = models.pop
        name = model.name

        DataMapper::Model.descendants.delete(model)

        if name && Object.const_defined?(name)
          Object.send(:remove_const, name)
        end

        cleanup_models(*models)
      end
    end

  end # CleanupModels
end # DataMaper::Mongo::Spec
{'fraction_non_alphanumeric': 0.08109833971902937, 'fraction_numerical': 0.0, 'mean_word_length': 2.644186046511628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6688590', 'n_tokens_mistral': 445, 'n_tokens_neox': 427, 'n_words': 124}