diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-17 12:53:17 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-18 13:07:31 +0300 |
commit | 867a1acc9046ed15afffe8ebc04e93a3628de1d2 (patch) | |
tree | c06712017480cc65c018a48479e04c5fdca19d23 /app/controllers/projects/releases_controller.rb | |
parent | 9004e18e6e0bca3deb7115b16e345f9755c012f3 (diff) |
Move Projects::ReleasesController under Tags
Rename Projects::ReleasesController to
Projects::Tags::ReleasesController
Diffstat (limited to 'app/controllers/projects/releases_controller.rb')
-rw-r--r-- | app/controllers/projects/releases_controller.rb | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb index c3d8f8a8d75..58d5ea4762f 100644 --- a/app/controllers/projects/releases_controller.rb +++ b/app/controllers/projects/releases_controller.rb @@ -4,30 +4,11 @@ class Projects::ReleasesController < Projects::ApplicationController # Authorize before_action :require_non_empty_project before_action :authorize_download_code! - before_action :authorize_push_code!, except: [:index] - before_action :tag, except: [:index] - before_action :release, except: [:index] - before_action :check_releases_page_feature_flag, only: [:index] + before_action :check_releases_page_feature_flag def index end - def edit - end - - def update - # Release belongs to Tag which is not active record object, - # it exists only to save a description to each Tag. - # If description is empty we should destroy the existing record. - if release_params[:description].present? - release.update(release_params) - else - release.destroy - end - - redirect_to project_tag_path(@project, @tag.name) - end - private def check_releases_page_feature_flag @@ -35,18 +16,4 @@ class Projects::ReleasesController < Projects::ApplicationController push_frontend_feature_flag(:releases_page) end - - def tag - @tag ||= @repository.find_tag(params[:tag_id]) - end - - # rubocop: disable CodeReuse/ActiveRecord - def release - @release ||= @project.releases.find_or_initialize_by(tag: @tag.name) - end - # rubocop: enable CodeReuse/ActiveRecord - - def release_params - params.require(:release).permit(:description) - end end |