Let's say I have an association where User has and belongs to many Roles. When I destroy the user, is the record in the join table automatically removed as well? Or do I need to use :dependent => :destroy? What about if I destroy a Role?
class User < ActiveRecord::Base
has_and_belong_to_many :roles # need to use :dependent => :destroy to remove join record?
end
class Role < ActiveRecord::Base
has_and_belong_to_many :users # need to use :dependent => :destroy to remove join record?
end