Closed gbarillot closed 2 months ago
Try using set_fixture_class
to explicitly set the model for the fixture.
Like this? Doesn't work :-/
class ActiveSupport::TestCase
set_fixture_class :users => User
end
I thought this was a regression bug in Rails 5 that was recently fixed?
I just did a quick read through - is your issue related to this? https://github.com/rails/rails/pull/27355
Unfortunately (and surprisingly), Rails upgrade to 5.0.1 (from current Github master as of today) didn't fix it. Sorry, still exactly the same error message. Is there something I'm missing or a real bug with Rails 5?
Anyone able to reproduce it?
@gbarillot Sorry for the slow reply, but what was the name of the model for the users table? Is it User
?
@gbarillot I have a little integration app that I use to sanity check multiple databases including SecondBase. I just updated the secondbaserails50 branch there with the latest Rails 5.0 and did this commit (https://github.com/customink/encom_dbs/commit/0bf0e640e6c1700729592206e26b81d5fa44de2f) to show that fixtures do indeed work as expected. Can you take a look?
Hi,
Thanks for this awesome Gem! I got it to work fine in the browser using development ENV. The problem is when I try to load YML fixtures in any of the second_base table while testing. Looks like Rails is always attempting to load them into the main DB, and not the second one. (No problem if the fixture belongs to the main DB.)
The error message I get when I launch the test :
In this example, the users table belongs to the second_base, and I do have this table in /db/second_base/schema.rb.
Test_helper.rb also include "require 'second_base/test_help'". (No significant changes if I remove it at that point)
Thank you if you can give me some pointers, for now I'm stuck...