Delete memberships when deleting associated groups.

This commit is contained in:
Benjamin Meichsner 2014-09-21 12:47:58 +02:00
parent 418a8b5806
commit 0231df9d5b

View file

@ -1,7 +1,7 @@
# Groups organize the User.
# A Member gets the roles from the Group
class Group < ActiveRecord::Base
has_many :memberships
has_many :memberships, dependent: :destroy
has_many :users, :through => :memberships
validates :name, :presence => true, :length => {:in => 1..25}
@ -37,5 +37,3 @@ class Group < ActiveRecord::Base
end
end
end