diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/services/releases/concerns.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/services/releases/concerns.rb')
-rw-r--r-- | app/services/releases/concerns.rb | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/app/services/releases/concerns.rb b/app/services/releases/concerns.rb deleted file mode 100644 index a0ebaea77c8..00000000000 --- a/app/services/releases/concerns.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module Releases - module Concerns - extend ActiveSupport::Concern - include Gitlab::Utils::StrongMemoize - - included do - def tag_name - params[:tag] - end - - def ref - params[:ref] - end - - def name - params[:name] || tag_name - end - - def description - params[:description] - end - - def released_at - params[:released_at] - end - - def release - strong_memoize(:release) do - project.releases.find_by_tag(tag_name) - end - end - - def existing_tag - strong_memoize(:existing_tag) do - repository.find_tag(tag_name) - end - end - - def tag_exist? - existing_tag.present? - end - - def repository - strong_memoize(:repository) do - project.repository - end - end - - def milestones - return [] unless param_for_milestone_titles_provided? - - strong_memoize(:milestones) do - MilestonesFinder.new( - project: project, - current_user: current_user, - project_ids: Array(project.id), - state: 'all', - title: params[:milestones] - ).execute - end - end - - def inexistent_milestones - return [] unless param_for_milestone_titles_provided? - - existing_milestone_titles = milestones.map(&:title) - Array(params[:milestones]) - existing_milestone_titles - end - - def param_for_milestone_titles_provided? - params.key?(:milestones) - end - end - end -end |