Maybe something like this would work for you?
http://wiki.rubyonrails.org/rails/pages/ManytoManyPolymorphicAssociations
-ns
On Jun 13, 1:15 pm, twoism
<signalsta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Could someone please help me with this association scheme? I am
> familiar with habtm as well as the :through association but this one
> has me stumped.
>
> Here is an example DB.
>
> Tags Table:
> -------------------------
> id
> name
>
> Taggables Table:
> --------------------------
> id
> tag_id
> taggble_type
> taggable_id
>
> For purposes of this example say that there are 2 other tables that
> can be tagged and their model name would appear in the taggable_type
> field along with their id in the taggable id.
>
> I have seen this done somewhat with the:
>
> belongs_to :taggable, :polymorphic => true
>
> but never with a join table or a :through to store extra info.
> Can this be done this way or am I completely off track?
>
> Thanks,
> Chris
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---