Destroy participations on event destruction

This commit is contained in:
Petko Bordjukov 2015-09-03 23:16:39 +03:00
parent 098d36c197
commit 58bb65a848
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class Event < ActiveRecord::Base
belongs_to :conference belongs_to :conference
belongs_to :track belongs_to :track
has_many :participations has_many :participations, dependent: :destroy
has_many :pending_participations, ->() { pending }, class_name: 'Participation' has_many :pending_participations, ->() { pending }, class_name: 'Participation'
has_many :approved_participations, ->() { approved }, class_name: 'Participation' has_many :approved_participations, ->() { approved }, class_name: 'Participation'
has_many :participants, through: :approved_participations has_many :participants, through: :approved_participations