Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Victorcorcos opened this issue Jun 30, 2020 · 1 comment
Open

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

Victorcorcos opened this issue Jun 30, 2020 · 1 comment

Comments

@Victorcorcos
Copy link

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.

@botandrose
Copy link
Contributor

@Victorcorcos Yes, you are correct. The behavior of the most recently released version of database_cleaner-mongoid (v1.x) does not match the README on Github because the master branch is tracking the upcoming v2.0 release, which makes some breaking changes, including renaming the Mongoid strategy from :truncation to :deletion. If you would like to open PR to update the README with a note about this, I'd merge it. You can copy the notice from the main database_cleaner repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants