Commit 10df55e11d976a11eb9ff71ff0c0c399d3f01c64

Authored by Dmitriy Zaporozhets
1 parent 132177c2

Added missing dependent for notes assoc

app/models/issue.rb
... ... @@ -2,7 +2,7 @@ class Issue < ActiveRecord::Base
2 2 belongs_to :project
3 3 belongs_to :author, :class_name => "User"
4 4 belongs_to :assignee, :class_name => "User"
5   - has_many :notes, :as => :noteable
  5 + has_many :notes, :as => :noteable, :dependent => :destroy
6 6  
7 7 attr_protected :author, :author_id, :project, :project_id
8 8  
... ...
app/models/merge_request.rb
... ... @@ -2,7 +2,7 @@ class MergeRequest < ActiveRecord::Base
2 2 belongs_to :project
3 3 belongs_to :author, :class_name => "User"
4 4 belongs_to :assignee, :class_name => "User"
5   - has_many :notes, :as => :noteable
  5 + has_many :notes, :as => :noteable, :dependent => :destroy
6 6  
7 7 attr_protected :author, :author_id, :project, :project_id
8 8  
... ...
app/models/snippet.rb
... ... @@ -3,7 +3,7 @@ class Snippet < ActiveRecord::Base
3 3  
4 4 belongs_to :project
5 5 belongs_to :author, :class_name => "User"
6   - has_many :notes, :as => :noteable
  6 + has_many :notes, :as => :noteable, :dependent => :destroy
7 7  
8 8 delegate :name,
9 9 :email,
... ...