diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-08-24 00:52:35 +0200 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2018-08-26 10:58:43 +0200 |
commit | 2e719bda0aec3970bcda06a21aa1e5eb41db323b (patch) | |
tree | 5fe03b2871724bfb6f80d5147ef914e580656654 /app/models/project.rb | |
parent | a32a410fb9bfcd378840b61426a54fd56d2ebd33 (diff) | |
download | gitlab-ce-2e719bda0aec3970bcda06a21aa1e5eb41db323b.tar.gz |
don't trigger project deletion hooks twice when removing a group
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 37231df979e..e042c2e6dd6 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -85,8 +85,7 @@ class Project < ActiveRecord::Base after_create :create_project_feature, unless: :project_feature after_create -> { SiteStatistic.track(STATISTICS_ATTRIBUTE) } - before_destroy ->(project) { project.project_feature } # keep reference so we can untrack later - after_destroy :untrack_site_statistics + before_destroy :untrack_site_statistics after_create :create_ci_cd_settings, unless: :ci_cd_settings, @@ -2095,7 +2094,7 @@ class Project < ActiveRecord::Base def untrack_site_statistics SiteStatistic.untrack(STATISTICS_ATTRIBUTE) - SiteStatistic.project_feature.untrack_statistics_for_deletion! + self.project_feature.untrack_statistics_for_deletion! end def execute_rename_repository_hooks!(full_path_before) |