summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-18 16:36:30 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 12:12:05 -0200
commita74a69db689b7e36c0e275a1094b1ad757bd6e86 (patch)
treeb76908b9b2ee656b264565cd4a34b38f6b08f6d8
parentbc54300ce5329b66d0ba726f814d9e761e782668 (diff)
downloadgitlab-ce-a74a69db689b7e36c0e275a1094b1ad757bd6e86.tar.gz
Use destroy, in case we ever have before_destroy callbacks on Task
-rw-r--r--app/models/note.rb2
-rw-r--r--spec/models/note_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 73412024f4e..31606cf8222 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -37,7 +37,7 @@ class Note < ActiveRecord::Base
belongs_to :author, class_name: "User"
belongs_to :updated_by, class_name: "User"
- has_many :tasks, dependent: :delete_all
+ has_many :tasks, dependent: :destroy
delegate :name, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index e146f53c3f7..70c3a999c95 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -27,7 +27,7 @@ describe Note, models: true do
it { is_expected.to belong_to(:noteable) }
it { is_expected.to belong_to(:author).class_name('User') }
- it { is_expected.to have_many(:tasks).dependent(:delete_all) }
+ it { is_expected.to have_many(:tasks).dependent(:destroy) }
end
describe 'validation' do