I just hit a big wall involving a legacy database. I’ve got an active
record class called “School” that uses “set_table_name ‘old_school’” to
map to a legacy database table:
class School < ActiveRecord::Base
It works great, until I’m testing and I want to use fixtures. I’ve got
a fixtures file called “old_school.yml” that doesn’t load. Following
some googled advice
I learned that I had to use set_fixture_class to be able to map the
fixture back to the class name:
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
set_fixture_class :old_school => School
Seems like it ought to work, but the fixtures still don’t load!
Looking in my test.log I find:
Unable to load old_school, underlying cause no such file to load –
fixtures' ./test/test_helper.rb:15 test/functional/admin_controller_test.rb:1:inrequire’
If I “require ‘school’” by hand, it makes no difference. The fixtures
still don’t load.
Has anybody run in to this? Does anyone have any suggestions?