Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rake db:fixtures:load doesn't resolve properly label references for associations

#6495

When using fixtures with "Label references for associations" (see doc activerecord/lib/active_record/fixtures.rb), the rake command rake db:fixtures:load fails to load the fixtures properly in the database. The DB column name is not translated properly and the field value isn't looked up and the label is put as the value instead of the id of the associated record.

Attached an app with label references in fixtures, just type rake db:fixtures:load and see it fails:

SQLite3::SQLException: table courses has no column named teacher: INSERT INTO "courses" ("subject", "teacher", "created_at", "updated_at", "id") VALUES ('Math', 'toto', '2011-03-01 16:52:15', '2011-03-01 16:52:15', 690422863)

With rails 3.0.5. Works with 2.3.10

Reported by gamov · March 1st, 2011 @ 05:42 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. gamov
    gamov

    Weirdly, I've created this test application because my big application that I'm migrating to rails 3 couldn't load the fixtures properly; the same way as this test app.
    Today, my big application loads the many fixtures with label references!?!

    March 2nd, 2011 @ 04:48 AM