diff --git a/app/models/issue.rb b/app/models/issue.rb index b8b4326..3da595d 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 6f8b0cd..d726d2d 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 d849a1d..ae25e8a 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, -- libgit2 0.21.2