Merge pull request #1161 from Ana06/room-event-schedule
Delete EventSchedules when a Room is deleted
This commit is contained in:
commit
c48c8afa51
2 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
class Room < ActiveRecord::Base
|
class Room < ActiveRecord::Base
|
||||||
belongs_to :venue
|
belongs_to :venue
|
||||||
has_many :event_schedules, dependent: :nullify
|
has_many :event_schedules, dependent: :destroy
|
||||||
|
|
||||||
has_paper_trail ignore: [:guid], meta: { conference_id: :conference_id }
|
has_paper_trail ignore: [:guid], meta: { conference_id: :conference_id }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ describe Room do
|
||||||
|
|
||||||
describe 'association' do
|
describe 'association' do
|
||||||
it { should belong_to(:venue) }
|
it { should belong_to(:venue) }
|
||||||
it { should have_many(:event_schedules).dependent(:nullify) }
|
it { should have_many(:event_schedules).dependent(:destroy) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'callback' do
|
describe 'callback' do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue