X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f72c34aaf85b736a2d4b880886ca84f490b28ba0..f3519e97819cc5a5e2c2f9931c7d565b8e5227c8:/app/models/issue.rb diff --git a/app/models/issue.rb b/app/models/issue.rb index 6de535e81..690a02477 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1,9 +1,10 @@ class Issue < ActiveRecord::Base belongs_to :reportable, :polymorphic => true belongs_to :user, :class_name => "User", :foreign_key => :reported_user_id + belongs_to :user_updated, :class_name => "User", :foreign_key => :updated_by - 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