diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-17 03:07:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-17 03:07:59 +0300 |
commit | 149436d2a55408accbf67f9301c0bfa3c6706fe6 (patch) | |
tree | 70f0bef042cfea7905ce92876d8af3c56fd520b6 /app/models/release.rb | |
parent | 06b21ad63ca4f7d0cada7cc44b9cddbf17df2193 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index 7f3af50e91e..cee52e132a4 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -25,6 +25,8 @@ class Release < ApplicationRecord before_create :set_released_at validates :project, :tag, presence: true + validates :tag, uniqueness: { scope: :project_id } + validates :description, length: { maximum: Gitlab::Database::MAX_TEXT_SIZE_LIMIT }, if: :description_changed? validates_associated :milestone_releases, message: -> (_, obj) { obj[:value].map(&:errors).map(&:full_messages).join(",") } validates :links, nested_attributes_duplicates: { scope: :release, child_attributes: %i[name url filepath] } |