Ruby on Rails Saturday, March 31, 2012

"Zoltán Iklódi" <ziklodi@gmail.com> wrote in post #1054400:
> Hello,
>
> I want to add a Partner property to more than one type of models (ie.
> SalesOrder and PurchaseOrder).
> Is this the proper way of defining associatons or there's a simpler
> way?

What you need here is a polymorphic association. See:

http://guides.rubyonrails.org/association_basics.html#polymorphic-associations

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