Ok, that's not the best subject line, but I couldn't think of a
concise way to describe what I'm trying to do.

I've got two models.  Grouping simply contains an id and a few other
attributes (e.g. rating).  A grouping can contain many elements which
are stored the Element model.

A set of elements is tied together by a grouping_id.  An element can
be one of several types of objects.  I'm doing this with polymorphic
associations.

I need a way to ensure that a grouping is unique.  That is, there
should not be two grouping_ids containing the exact same elements.

The closest analogy I can think of is a composite primary key.
Except, this is across multiple rows (instead of columns) and uses
polymorphic association types and ids.

Can this be easily done with Rails and ActiveRecord?

Thanks,
Raj
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to