Method: ActiveRecord::TestFixtures::ClassMethods#set_fixture_class
- Defined in:
- activerecord/lib/active_record/test_fixtures.rb
#set_fixture_class(class_names = {}) ⇒ Object
Sets the model class for a fixture when the class name cannot be inferred from the fixture name.
Examples:
set_fixture_class some_fixture: SomeModel,
'namespaced/fixture' => Another::Model
The keys must be the fixture names, that coincide with the short paths to the fixture files.
52 53 54 |
# File 'activerecord/lib/active_record/test_fixtures.rb', line 52 def set_fixture_class(class_names = {}) self.fixture_class_names = fixture_class_names.merge(class_names.stringify_keys) end |