On Oct 11, 10:49 pm, Peter Vandenabeele <[email protected]>
wrote:
> * you can find all details about these association methods in section
>   "4.2 has_one Association Reference" 
> ofhttp://guides.rubyonrails.org/association_basics.html
> * actually, I believe what you propose above will not work, it would
> probably be
>
>  @user.build_referral # untested


You were absolutely right, @user.build_referral works, I have tested
it and it has been clearly mentioned in the rubyonrails guides.

>@user.referral.build

would have worked only if the association was of the type has_many or
has_and_belongs_to_many

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to