diff --git a/app/models/booth.rb b/app/models/booth.rb index 686f3690..e692c663 100644 --- a/app/models/booth.rb +++ b/app/models/booth.rb @@ -2,7 +2,7 @@ class Booth < ActiveRecord::Base include ActiveRecord::Transitions belongs_to :conference - has_many :booth_requests + has_many :booth_requests, dependent: :destroy has_many :users, through: :booth_requests has_one :submitter_booth_user, -> { where(role: 'submitter') }, class_name: 'BoothRequest' diff --git a/app/models/user.rb b/app/models/user.rb index 1f953893..f3f03ab7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -57,6 +57,7 @@ class User < ActiveRecord::Base has_many :subscriptions, dependent: :destroy has_many :tracks, foreign_key: 'submitter_id' has_many :booth_requests + has_many :booth_requests, dependent: :destroy has_many :booths, through: :booth_requests accepts_nested_attributes_for :roles