diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/models/release.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index 0fda6940249..c6c0920c4d0 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -5,6 +5,8 @@ class Release < ApplicationRecord include CacheMarkdownField include Importable include Gitlab::Utils::StrongMemoize + include EachBatch + include FromUnion cache_markdown_field :description @@ -24,6 +26,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] } |