Comments (7)
Hmm... I've been using Mongoid with v0.6.x for several months now. I've been using it without a problem with Rails 3.0. Did you set the strategy to be :truncation?
from database_cleaner.
yes. I tried DatabaseCleaner[:mongoid].strategy = :truncation, it failed.
Now I am using v0.5.2 with config :
DatabaseCleaner.orm = "mongoid"
DatabaseCleaner.strategy = :truncation
it works.
from database_cleaner.
Any way you could reproduce this in a new project and push it to github? Something different in your setup is causing this bug where my setup and the tests are not catching...
from database_cleaner.
Hi, I pushed a example project at: git://github.com/stonegao/databasecleaner-debug.git
you can run:
rake spec
to reproduce the bug
from database_cleaner.
Thanks for taking the time for creating this! I was quickly able to spot the problem. The main problem is that DatabaseCleaner was not converting the orm type into symbols. So, you were passing "mongoid" but internally symbols are used for comparison and since #to_sym
was never being called there were issues...
This has also brought up a couple more issues where DatabaseCleaner could issue better warnings and provide better documentation. Anyways, I will work on some patches to avoid these issues in the future. For now, take a look at my commit to see what I had to do to make it work correctly:
bmabey/databasecleaner-debug@0c924cf
from database_cleaner.
cool. thanks for the fix :-)
from database_cleaner.
I just pushed a fix to database_cleaner
's master
and have created a new ticket based off of another bug I found with this setup. Thanks again!
from database_cleaner.
Related Issues (20)
- DatabaseCleaner triggering `before` hook while threads are still running HOT 2
- url_allowlist only works against DATABASE_URL HOT 1
- Data
- uninitialized constant ActiveRecord::DatabaseConfigurations::ConnectionUrlResolver::URI HOT 2
- Remote database is wiped out HOT 2
- API documentation is empty HOT 1
- YAML aliases with Ruby 3.1 HOT 8
- Hand soap HOT 1
- NoMethodError: undefined method 'state' for nil:NilClass HOT 7
- Change strategy for specific test
- 0.0.0.0 doesn't count as a local host HOT 2
- Rspec tests freeze as soon as DatabaseCleaner begins to work HOT 1
- Feature spec should complete after showing the result
- Prevent cleaning of development database HOT 1
- Highly variable duration of truncations (not a database_cleaner issue)
- Deprecation warning on: DatabaseCleaner.clean_with(:truncation) HOT 1
- Reading Database config from database.yml HOT 1
- Is this gem compatible with ruby 3.2.2 HOT 1
- Issue with Rails 7.2
- NoMethodError error schema_migration with Rails 7.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from database_cleaner.