summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-17 08:48:29 +0000
committerDouwe Maan <douwe@gitlab.com>2015-11-17 08:48:29 +0000
commitc12d0b4d2aba9bd9e162de15025353dc6e989df9 (patch)
tree754c32cdafe4574d98f7b832504fe9061d2612a1 /app
parent03cb8edb34ab0d19049931434863b585d85de238 (diff)
parentccb0c40c54d913fe140231c88f4adcd2d41c5b87 (diff)
downloadgitlab-ce-c12d0b4d2aba9bd9e162de15025353dc6e989df9.tar.gz
Merge branch 'rs-wiki-touches-project' into 'master'
Make ProjectWiki touch Project#last_activity_at after wiki actions Closes #3026 See merge request !1803
Diffstat (limited to 'app')
-rw-r--r--app/models/project_wiki.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index 231973fa543..b5fec38378b 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -86,6 +86,8 @@ class ProjectWiki
commit = commit_details(:created, message, title)
wiki.write_page(title, format, content, commit)
+
+ update_project_activity
rescue Gollum::DuplicatePageError => e
@error_message = "Duplicate page: #{e.message}"
return false
@@ -95,10 +97,14 @@ class ProjectWiki
commit = commit_details(:updated, message, page.title)
wiki.update_page(page, page.name, format, content, commit)
+
+ update_project_activity
end
def delete_page(page, message = nil)
wiki.delete_page(page, commit_details(:deleted, message, page.title))
+
+ update_project_activity
end
def page_title_and_dir(title)
@@ -146,4 +152,8 @@ class ProjectWiki
def path_to_repo
@path_to_repo ||= File.join(Gitlab.config.gitlab_shell.repos_path, "#{path_with_namespace}.git")
end
+
+ def update_project_activity
+ @project.touch(:last_activity_at)
+ end
end