Comments (8)
I added a monkey patch in an initializer:
if defined?(DatabaseCleaner)
module DatabaseCleaner
module ActiveRecord
class Base
private
def load_config
if db != :default && db.is_a?(Symbol) && File.file?(DatabaseCleaner::ActiveRecord.config_file_location)
connection_details = YAML::load(ERB.new(IO.read(DatabaseCleaner::ActiveRecord.config_file_location)).result, aliases: true)
@connection_hash = valid_config(connection_details, db.to_s)
end
end
end
end
end
end
from database_cleaner.
@jacobat Thanks for submitting this issue! Would you be interested in submitting a PR so that people no longer have to use that monkey patch?
from database_cleaner.
Same problem over here. It "works" if I remove database cleaner.
@jacobat, did you find some solution? The only way I found was to remove alias at database.yml
and duplicate all the config.
from database_cleaner.
Thanks, man!
from database_cleaner.
@etagwerker I believe this is fixed on active_record
adapter on https://github.com/DatabaseCleaner/database_cleaner-active_record/blob/v2.1.0/lib/database_cleaner/active_record/base.rb#L57 but we need a new version of database-cleaner released with a loosen restriction on https://github.com/DatabaseCleaner/database_cleaner/blob/main/database_cleaner.gemspec#L19 otherwise we can't update the active-record adapter with the fix with an bundle update database_cleaner-active_record
.
This is the fix: DatabaseCleaner/database_cleaner-active_record@b750ac7
I suggest using just ~> 2
there to easy future updates to get minor and patch fixes.
from database_cleaner.
@jvortmann Sounds like a good idea. Thank you!
from database_cleaner.
Thank you!
from database_cleaner.
Related Issues (20)
- allow_remote_database_url not working as expected HOT 2
- Undefined method `rollback' for nil:NilClass HOT 1
- 2.0 Regression: allow_remote_database_url and url_allowlist not working anymore HOT 10
- NoMethodError: undefined method `orm=' for DatabaseCleaner:Module HOT 2
- Strategy :transaction doesn't work with click_button HOT 2
- Feature request: specify when to stop re-raising server errors when raise_server_errors=true HOT 1
- Ruby 3 compatibility HOT 9
- Deprecation Warning on 2.7 HOT 4
- Poor strategy class lookup HOT 1
- 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
- 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
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.