X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f72c34aaf85b736a2d4b880886ca84f490b28ba0..b68b29b43c2e385af05d81815e347c2ab22ed269:/app/models/issue.rb?ds=inline diff --git a/app/models/issue.rb b/app/models/issue.rb index 6de535e81..0abc27063 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -2,8 +2,8 @@ class Issue < ActiveRecord::Base belongs_to :reportable, :polymorphic => true belongs_to :user, :class_name => "User", :foreign_key => :reported_user_id - has_many :reports - has_many :comments, :class_name => "IssueComment" + has_many :reports, dependent: :destroy + has_many :comments, :class_name => "IssueComment", dependent: :destroy validates :reportable_id, :uniqueness => { :scope => [ :reportable_type ] } validates :reported_user_id, :presence => true