diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 06:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 06:06:26 +0300 |
commit | 56d96ad7fab4d4b95f5529d8080b3cc2873794a0 (patch) | |
tree | 7fe93fc8ff4d82d815000781ffb9c98d7259211a /app/models/release.rb | |
parent | 8078bd185fd9fce86cb5a8d9a6b6209e0c23ae44 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index a069e1523b8..1261402712f 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -27,13 +27,17 @@ class Release < ApplicationRecord validates_associated :milestone_releases, message: -> (_, obj) { obj[:value].map(&:errors).map(&:full_messages).join(",") } scope :sorted, -> { order(released_at: :desc) } - scope :with_project_and_namespace, -> { includes(project: :namespace) } + scope :preloaded, -> { includes(project: :namespace) } delegate :repository, to: :project after_commit :create_evidence!, on: :create after_commit :notify_new_release, on: :create + def to_param + CGI.escape(tag) + end + def commit strong_memoize(:commit) do repository.commit(actual_sha) |