i have a list of COMPOUNDS (combinations) that have any number of COMPOUND_MATERIALS of which both are ITEMS. (this is for a video game item database) i want to validate that the compounds are unique by validating it''s combination of compound_materials does not already exist (a compound can have multiple combinations of materials) my tables: ITEMS id name ... COMPOUNDS (has many compound materials) id item_id COMPOUND_MATERIALS id compound_id item_id so how would i use this in my model? validates_uniqueness_of :item_id, scope => [''compound_materials.item_id'', .... something like that but i''m confused because a compound can have any number of compound_materials so I''m not sure how to write that out. thanks. -- 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-/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 -~----------~----~----~----~------~----~------~--~---