This project is archived and is in readonly mode.

#2965 ✓resolved
kmpm

Advanced / foxy fixture features doesn't work well with models in modules

Reported by kmpm | July 28th, 2009 @ 03:37 PM | in 3.0.2

If models reside within modules then fixture loading doesn't work when you use advanced / foxy fixture features like label references.
The attached patch adds some tests that fail already when loading.
test_relations(FoxyFixturesInModulesTest):<br/> ActiveRecord::StatementInvalid: SQLite3::SQLException: table tracks has no column named album: INSERT INTO "tracks" ("title", "album") VALUES ('Foxy Lady', 'album1')<br/>

One could argue the set_table_name and/or set_fixture_class should be used but that is certainly not convention over configuration and you can't do set_fixture_class when doing a rake db:fixtures:load.

According to #1976 so should fixtures for a module possibly be in a folder with the fixture name by default but that makes the current situation even worse.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages