error w/dynamic fixtures

Hey All,

I'm trying to do the basic test/unit stuff & having trouble w/a dynamic fixture error. I'm running rails 2.0.2 on windows.

I have statuses & projects. Projects belong_to status and so forth.

# statuses.yml =================== active:   name: Active   description: MyString

# projects.yml =================== one:   name: Center for Health Communications Research   abbreviation: CHCR   description: A collection of 3 projects.   grant_number: 8   status_id: <%= statuses(:active).id %>   start_date: 2008-03-20   end_date: 2008-03-20

That is correct and the statuses method probably isn't even defined in the context you are using this in. The write way to do this is to put

status: active

in that fixture. As long as you have the status belongs_to association, rails will figure out that this means that you want the status_id column to have the value of the id of the status fixture with label 'active'. This won't work if your fixture for statuses explicitly sets an id.

Fred

Sweetness--thanks!

-Roy