Destroy proposables that depend on a proposition
This commit is contained in:
parent
29f27306b6
commit
096befa2ef
|
@ -1,6 +1,6 @@
|
||||||
class Proposition < ActiveRecord::Base
|
class Proposition < ActiveRecord::Base
|
||||||
belongs_to :proposer, class_name: 'User'
|
belongs_to :proposer, class_name: 'User'
|
||||||
belongs_to :proposable, polymorphic: true
|
belongs_to :proposable, polymorphic: true, dependent: :destroy
|
||||||
enum status: [:undecided, :approved, :rejected, :backup]
|
enum status: [:undecided, :approved, :rejected, :backup]
|
||||||
delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable
|
delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue