From 58bb65a848af2fd7493e829bfc4a54bf91612c10 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 3 Sep 2015 23:16:39 +0300 Subject: [PATCH] Destroy participations on event destruction --- app/models/event.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/event.rb b/app/models/event.rb index 5edc660..26f1957 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -4,7 +4,7 @@ class Event < ActiveRecord::Base belongs_to :conference belongs_to :track - has_many :participations + has_many :participations, dependent: :destroy has_many :pending_participations, ->() { pending }, class_name: 'Participation' has_many :approved_participations, ->() { approved }, class_name: 'Participation' has_many :participants, through: :approved_participations