diff --git a/app/models/issue.rb b/app/models/issue.rb index b8b43267..3da595d9 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -2,7 +2,7 @@ class Issue < ActiveRecord::Base belongs_to :project belongs_to :author, :class_name => "User" belongs_to :assignee, :class_name => "User" - has_many :notes, :as => :noteable + has_many :notes, :as => :noteable, :dependent => :destroy attr_protected :author, :author_id, :project, :project_id diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 6f8b0cdf..d726d2d0 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -2,7 +2,7 @@ class MergeRequest < ActiveRecord::Base belongs_to :project belongs_to :author, :class_name => "User" belongs_to :assignee, :class_name => "User" - has_many :notes, :as => :noteable + has_many :notes, :as => :noteable, :dependent => :destroy attr_protected :author, :author_id, :project, :project_id diff --git a/app/models/snippet.rb b/app/models/snippet.rb index d849a1d3..ae25e8a3 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -3,7 +3,7 @@ class Snippet < ActiveRecord::Base belongs_to :project belongs_to :author, :class_name => "User" - has_many :notes, :as => :noteable + has_many :notes, :as => :noteable, :dependent => :destroy delegate :name, :email,