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
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)
COMPOUNDS (has many compound materials)
so how would i use this in my model?
validates_uniqueness_of :item_id, scope =>
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.