Use destroy, in case we ever have before_destroy callbacks on Task

parent bc54300c
...@@ -37,7 +37,7 @@ class Note < ActiveRecord::Base ...@@ -37,7 +37,7 @@ class Note < ActiveRecord::Base
belongs_to :author, class_name: "User" belongs_to :author, class_name: "User"
belongs_to :updated_by, 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, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true delegate :name, :email, to: :author, prefix: true
......
...@@ -27,7 +27,7 @@ describe Note, models: true do ...@@ -27,7 +27,7 @@ describe Note, models: true do
it { is_expected.to belong_to(:noteable) } it { is_expected.to belong_to(:noteable) }
it { is_expected.to belong_to(:author).class_name('User') } 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 end
describe 'validation' do describe 'validation' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment