My application spans 2 (or more) databases for some very specific
reasons… My models are working fine, even dynamically establishing
connections as needed at runtime, and spanning relationships across the
databases (which really impressed me). The problem is, I can’t seem to
force Units for these models (that use a secondary db) to load their
fixtures into and use the secondary database.
I tried applying this:
(where :test_group is a database connection defined in database.yml)
at various locations within the test itself, and test_helper.rb… but
my unit is failing with this error:
ActiveRecord::StatementInvalid: Mysql::Error: Table
‘scoot_test.projects’ doesn’t exist: DELETE FROM projects
(and scoot_test is the ‘main’ database, but projects should be a table
in the ‘secondary’ database)
So, any advice on how I might be able to get this to work?