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.
validates_uniqueness_of :category_id, :scope => :inventory_id
might do the trick.
Keep up to date with Rails on Twitter and This Week in Rails
Policies: Conduct, License, Maintenance, Security, Trademarks