diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-26 18:10:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-26 18:10:57 +0300 |
commit | ede9464fd957582e4e0232f70113942b08ddfe78 (patch) | |
tree | 186b5e12e612810dbf8d4209126737726dd23289 /app/services/pages | |
parent | 04f9cef437b65b4a62624936a37a99cfbfb4d61c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/pages')
-rw-r--r-- | app/services/pages/delete_service.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/pages/delete_service.rb b/app/services/pages/delete_service.rb index c4009dcc4ec..f7d3d70aad6 100644 --- a/app/services/pages/delete_service.rb +++ b/app/services/pages/delete_service.rb @@ -3,8 +3,13 @@ module Pages class DeleteService < BaseService def execute - project.mark_pages_as_not_deployed # prevents domain from updating config when deleted - project.pages_domains.delete_all + project.mark_pages_as_not_deployed + + # project.pages_domains.delete_all will just nullify project_id: + # > If no :dependent option is given, then it will follow the default + # > strategy for `has_many :through` associations. + # > The default strategy is :nullify which sets the foreign keys to NULL. + PagesDomain.for_project(project).delete_all DestroyPagesDeploymentsWorker.perform_async(project.id) |