This project is archived and is in readonly mode.
has_and_belongs_to_many doesn't get the fixtures
Reported by xdmx | August 24th, 2008 @ 06:28 PM | in 2.x
(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
Comments and changes to this ticket
-
Kostas K. November 12th, 2008 @ 10:41 AM
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
-
Pratik March 12th, 2009 @ 03:56 PM
- State changed from new to invalid
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>