Labeled fixtures for associations in Rails 3 broken

Posted by elsurudo on Stack Overflow See other posts from Stack Overflow or by elsurudo
Published on 2010-06-11T22:28:57Z Indexed on 2010/06/11 22:32 UTC
Read the original article Hit count: 344

After upgrading to Rails 3, fixtures that refer to other labelled fixtures (for relationships) stop working. Instead of finding the actual fixture with that name, the fixture label is interpreted as a string.

Example:

# Dog.yml

sparky:
  name: Sparky
  owner: john

# Person.yml

john:
  name: John

Where Dog "belongs to" person.

The error message is:

SQLite3::SQLException: table dogs has no column named 'owner'

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails3