Ruby on Rails Wednesday, December 29, 2010

> Still using the data model I advised you against, I see...

Yes, unfortunately my boss has been pushing to get a first version
online within two weeks. I've decided to stick with this structure for
now and then restructure after launch, especially since only 3-4 clients
will be using this initially.

> ...but in any case, I think you want @timesheet.fire_fighters.create,
> not @timesheet.create_fire_fighter , which doesn't exist on has_many.

Thanks, I did not know that 'create_modelname' was only available with
has_one relationships.

>> I tested it with the console, Tiemsheet.last.fire_fighters returns an
>> empty array []
>
> You do know that Timesheet.last will return an arbitrary timesheet, and
> that you can't predict which one it returns, right?

Yes, I was just using that to test if the association was working
correctly.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment