blob: b852673d82a60971d7dd0cf30ca0eafe6fe81164 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# frozen_string_literal: true
class Projects::Tags::ReleasesController < Projects::ApplicationController
# Authorize
before_action :require_non_empty_project
before_action :authorize_download_code!
before_action :authorize_push_code!
before_action :tag
before_action :release
feature_category :release_evidence
urgency :low
def edit
end
def update
release.update(release_params) if release.persisted? || release_params[:description].present?
redirect_to project_tag_path(@project, tag.name)
end
private
def tag
@tag ||= @repository.find_tag(params[:tag_id])
end
def release
@release ||= Releases::CreateService.new(project, current_user, tag: @tag.name)
.find_or_build_release
end
def release_params
params.require(:release).permit(:description)
end
end
|