Destroy proposables that depend on a proposition

This commit is contained in:
Petko Bordjukov 2016-10-07 02:53:20 +03:00
parent 29f27306b6
commit 096befa2ef
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
class Proposition < ActiveRecord::Base
belongs_to :proposer, class_name: 'User'
belongs_to :proposable, polymorphic: true
belongs_to :proposable, polymorphic: true, dependent: :destroy
enum status: [:undecided, :approved, :rejected, :backup]
delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable