You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running Rails in development in a Dockerized environment. One of the configured Docker Compose services is a container to run commands (e.g. rails, rake, ...) and its RAILS_ENV is development. If I accidentally run rspec in that particular container, my development database gets cleaned, which is not what I want.
I tried configuring DatabaseCleaner.url_whitelist to include the full URL to the test database. For example:
2.7.2
6.0.3.4
1.8.5
1.8.0
I'm running Rails in development in a Dockerized environment. One of the configured Docker Compose services is a container to run commands (e.g.
rails
,rake
, ...) and itsRAILS_ENV
isdevelopment
. If I accidentally runrspec
in that particular container, my development database gets cleaned, which is not what I want.I tried configuring
DatabaseCleaner.url_whitelist
to include the full URL to the test database. For example:But it looks like only base URLs are considered.
Then I tried allowing remote URLs for the test environment alone by adding the following line at the top of
support/database_cleaner.rb
:But that's ignored for some reason. I checked if
Rails.env.test?
isfalse
at that point, and it is.So now I've replaced that line with:
Which works. But isn't
allow_remote_database_url
supposed to do the same? Or am I missing something crucial?The text was updated successfully, but these errors were encountered: