Topic: has_and_belongs_to_many and dependence
Hi! How can I use the behaviour that :dependence => :destroy does when using has_and_belongs_to_many??
My particular problem is: I have items, each one tagged with some tags:
class Item < ActiveRecord::Base
class Tag < ActiveRecord::Base
validates_uniqueness_of :name, :case_sensitive => false
...so that an item has some tags, but tags that are not bound to any item should not exist. I would like that tags don't exist if they are not bound to any item, which is a similar behaviour to that in has_many when using :dependence => :destroy.
How can I do it?