Very cool! Thanks for the answer. But inverse associations are only a
component of those double sided polymorphic associations.
At the present you can only make one sided associations. Table talking
it means the following:

Single sided polymorphic:
 -----------------------------------------------
| origin_id | destination_id | destination_type |
 -----------------------------------------------

Double sided polymorphic:
 -------------------------------------------------------------
| origin_id | origin_type | destination_id | destination_type |
 -------------------------------------------------------------

This way there's only on table to track all these relations. It allows
every model to be associated with every other model as many times as
needed.
For a better explanation I wrote something on Stackoverflow -> Here is
the link again:
http://stackoverflow.com/questions/2224994/why-are-double-sided-polymorphic-relationships-lacking-in-rails&usg=AFQjCNEK8nv15YTOV3IYYh-2od_6Ng4Eug

On Feb 8, 10:12 pm, Mat Brown <[email protected]> wrote:
> Inverse associations will be standard in Rails 2.3.6. For the
> impatient, here's a backport:
>
> http://github.com/oggy/inverse_of
>
> Mat
>
>
>
> On Mon, Feb 8, 2010 at 16:43, tsenart <[email protected]> wrote:
> >http://stackoverflow.com/questions/2224994/why-are-double-sided-polym...
>
> > --
> > 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 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.

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