Add before_destroy :cancel to precent role destroy.Change Conference-Role association to have dependent: :destroy_all
This commit is contained in:
parent
2df6d1039f
commit
48b48e88ac
2 changed files with 10 additions and 2 deletions
|
|
@ -4,7 +4,8 @@ class Conference < ActiveRecord::Base
|
|||
require 'uri'
|
||||
serialize :events_per_week, Hash
|
||||
# Needed to call 'Conference.with_role' in /models/ability.rb
|
||||
resourcify
|
||||
# Dependent destroy will fail as roles#destroy will be cancelled,hence delete_all
|
||||
resourcify :roles, dependent: :delete_all
|
||||
|
||||
default_scope { order('start_date DESC') }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue