Ruby on Rails Friday, September 3, 2010

On Fri, Sep 3, 2010 at 6:07 AM, Satsou Sa <lists@ruby-forum.com> wrote:

> I had tried to write those factories:
>
>  Factory.define :article do |f|
>    f.title "Hello, world"
>  end
>
>  Factory.define :comment do |f|
>    f.content "Awesome!"
>    f.association :article
> end

I'm still pretty newb, so I could be way off here, but I think you
need to define the factory that represents the association?

Factory.define :comment do |f|
f.content "Awesome!"
f.association :article, :factory => :article
end

--
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