Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-08-06 13:51:37 +0300
committerNick Thomas <nick@gitlab.com>2018-08-06 13:51:37 +0300
commitf6e6faee68e16fde00e44caa9b8c0c527aa79689 (patch)
treea5a357c4e596c27a96d4a12e2b83f982939588ca /app
parentbc1f851fdfaf9cc2bba5b67fd762e8802023bf5c (diff)
parent79d90cb6bd99b7af572c65af89597c2e55217aea (diff)
Merge branch 'jr-archive-hook' into 'master'
Trigger `project_update` system hook when archiving projects See merge request gitlab-org/gitlab-ce!20995
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/models/project.rb8
2 files changed, 2 insertions, 10 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9d1c44db137..4d7e33d7b11 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -148,7 +148,7 @@ class ProjectsController < Projects::ApplicationController
def archive
return access_denied! unless can?(current_user, :archive_project, @project)
- @project.archive!
+ ::Projects::UpdateService.new(@project, current_user, archived: true).execute
respond_to do |format|
format.html { redirect_to project_path(@project) }
@@ -158,7 +158,7 @@ class ProjectsController < Projects::ApplicationController
def unarchive
return access_denied! unless can?(current_user, :archive_project, @project)
- @project.unarchive!
+ ::Projects::UpdateService.new(@project, current_user, archived: false).execute
respond_to do |format|
format.html { redirect_to project_path(@project) }
diff --git a/app/models/project.rb b/app/models/project.rb
index 02e956911a9..cb4d2610e0d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1320,14 +1320,6 @@ class Project < ActiveRecord::Base
:visibility_level
end
- def archive!
- update_attribute(:archived, true)
- end
-
- def unarchive!
- update_attribute(:archived, false)
- end
-
def change_head(branch)
if repository.branch_exists?(branch)
repository.before_change_head