Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a32a410f
Commit
a32a410f
authored
Aug 23, 2018
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move wiki statistics deletion to after_destroy
parent
93160083
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
app/models/project.rb
app/models/project.rb
+7
-2
No files found.
app/models/project.rb
View file @
a32a410f
...
...
@@ -85,8 +85,8 @@ class Project < ActiveRecord::Base
after_create
:create_project_feature
,
unless: :project_feature
after_create
->
{
SiteStatistic
.
track
(
STATISTICS_ATTRIBUTE
)
}
before_destroy
->
(
project
)
{
project
.
project_feature
.
untrack_statistics_for_deletion!
}
after_destroy
->
{
SiteStatistic
.
untrack
(
STATISTICS_ATTRIBUTE
)
}
before_destroy
->
(
project
)
{
project
.
project_feature
}
# keep reference so we can untrack later
after_destroy
:untrack_site_statistics
after_create
:create_ci_cd_settings
,
unless: :ci_cd_settings
,
...
...
@@ -2093,6 +2093,11 @@ class Project < ActiveRecord::Base
Gitlab
::
PagesTransfer
.
new
.
rename_project
(
path_before
,
self
.
path
,
namespace
.
full_path
)
end
def
untrack_site_statistics
SiteStatistic
.
untrack
(
STATISTICS_ATTRIBUTE
)
SiteStatistic
.
project_feature
.
untrack_statistics_for_deletion!
end
def
execute_rename_repository_hooks!
(
full_path_before
)
# When we import a project overwriting the original project, there
# is a move operation. In that case we don't want to send the instructions.
...
...
Write
Preview
Markdown
is supported
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