Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9967b9aa83bc
Commit
9967b9aa
authored
Mar 09, 2016
by
Douglas Barbosa Alexandre
Browse files
Destroy all related todos when removing a project
parent
3e827d9d7e83
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
9967b9aa
...
...
@@ -151,6 +151,7 @@
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"
...
...
spec/models/project_spec.rb
View file @
9967b9aa
...
...
@@ -68,6 +68,7 @@
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment