I’m not 100% on :unique => true but you should be able to put validation into your join model to prevent these kinds of issues.
eg
validates_uniqueness_of :category_id, :scope => :inventory_id
might do the trick.
I’m not 100% on :unique => true but you should be able to put validation into your join model to prevent these kinds of issues.
eg
validates_uniqueness_of :category_id, :scope => :inventory_id
might do the trick.