Why does :dependent => :restrict throw an error?
This question Check all associations before destroy in rails suggests using :dependent => :restrict.
Why do I get ArgumentError: Unknown key(s): dependent?
Does this work with has_and_belongs_to_many?
Why is there no mention in the docs? http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
Was it introduced after 3.0.7?
:dependent cannot be used with has_and_belongs_to_many. The docs you link to list the association methods that accept it: has_many, has_one and belongs_to.
You could add a before_remove hook and do your dependent check manually.