diff --git a/app/models/issue.rb b/app/models/issue.rb index b8b432673a4996b616c47bbdbbb1c3d4b9f24b6c..3da595d91c2623d559b6441ed374f8d90e97c77a 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 6f8b0cdfedd43bf417904741d42210c408569b78..d726d2d046db68069e37d652b848176b59454da2 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 d849a1d3f611463c0502fa21a84ccb14bfc55c7f..ae25e8a3bb8954b7dcefeea9a25ef2ce6f9aebbc 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,