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.

has_and_belongs_to_many doesn't get the fixtures

#894

(rails 2.1.0 and 2.0.2)

Two models: Users and Projects Connected with has_and_belongs_to_many_projects

*** users.yml

first: username: test

*** projects.yml

first: name: test project

*** projects_users.yml

first: user: first project: first

This doesn't work, it fail saying that there is any "user" and "project".

I've tried also

*** projects_users.yml

first: user: <%= users(:first) %> project: <%= projects(:first) %>

But still doesn't work

So i tried

*** projects_users.yml

first: user_id: <%= users(:first).id %> project_id: <%= projects(:first).id %>

And still nothing... just errors: undefined method 'users' for main:Object

Reported by xdmx · August 24th, 2008 @ 06:28 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Kostas K.
    Kostas K.

    I think that you need to use it like this:

    *** users.yml

    first: username: test projects: first

    *** projects.yml

    first: name: test project users: first

    November 12th, 2008 @ 10:41 AM

  2. Pratik
    Pratik
    • State changed from new to invalid

    March 12th, 2009 @ 03:56 PM