Open junhanamaki opened 9 years ago
:+1: I'm seeing this as well with a similar configuration of connecting to MySQL but with multiple databases on the same server. A "normal" model that should connect to the default configured under the "test" key is switching to the non-default "other_test" connection.
Bump? I'm seeing this as well
Is there any chance of this being prioritised please? My app has a number of extra schemas specified in schema_search_path
and database cleaner cleans them properly in database_cleaner (1.99.0)
but not the modern configuration of database_cleaner-active_record (2.1.0)
+ database_cleaner-core (~> 2.0.0)
(from Gemfile.lock
)
Hi. I've been having trouble with making database cleaner work when trying to delete data from different psql schemas, but in the same database.
database.yml:
What I did in spec_helper:
From what I understand it happens because of this code:
This method is invoked from connection_class, and because both connection "test" and "test_non_public" are configured to connect to the same database it ends up returning a model with an incorrect connection. This could be solved (I think) by adding one more condition, so that besides checking for the database_name it also checks for the schema_search_path.
While writing this issue I ended up editing the code as follows and it worked:
Does it look like a good fix? If not how should I approach this problem so that I can solve this issue?
Thanks