Destroy all related todos when removing a project
This commit is contained in:
parent
500337c4b2
commit
9e342fb00a
2 changed files with 2 additions and 0 deletions
|
@ -151,6 +151,7 @@ class Project < ActiveRecord::Base
|
|||
has_many :releases, dependent: :destroy
|
||||
has_many :lfs_objects_projects, dependent: :destroy
|
||||
has_many :lfs_objects, through: :lfs_objects_projects
|
||||
has_many :todos, dependent: :destroy
|
||||
|
||||
has_one :import_data, dependent: :destroy, class_name: "ProjectImportData"
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ describe Project, models: true do
|
|||
it { is_expected.to have_many(:runners) }
|
||||
it { is_expected.to have_many(:variables) }
|
||||
it { is_expected.to have_many(:triggers) }
|
||||
it { is_expected.to have_many(:todos).dependent(:destroy) }
|
||||
end
|
||||
|
||||
describe 'modules' do
|
||||
|
|
Loading…
Reference in a new issue