Skip to content

The 'deletion' strategy does not exist for the mongoid ORM! #14

@Victorcorcos

Description

@Victorcorcos

On the README file, there is a section that says only the :deletion strategy is available on mongoid. However, it seems like it is quite the opposite, only the :truncation strategy is available.

I tried to use the :deletion strategy and the following error message is displayed:

> DatabaseCleaner[:mongoid].strategy = :deletion

DatabaseCleaner::UnknownStrategySpecified: The 'deletion' strategy does not exist for the mongoid ORM!  Available strategies: truncation
from /Users/victor/.rvm/gems/ruby-2.6.5@pocket/gems/database_cleaner-1.8.4/lib/database_cleaner/base.rb:150:in `rescue in require_orm_strategy'
Caused by LoadError: cannot load such file -- database_cleaner/mongoid/deletion
from /Users/victor/.rvm/gems/ruby-2.6.5@pocket/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
Caused by NameError: uninitialized constant DatabaseCleaner::Mongoid::Deletion
from /Users/victor/.rvm/gems/ruby-2.6.5@pocket/gems/database_cleaner-1.8.4/lib/database_cleaner/base.rb:135:in `const_get'

Is the README outdated?

Please take a look at the README section below...
👇

Supported Strategies

The mongoid adapter only has one strategy: the deletion strategy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions