Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/release.rb')
-rw-r--r--app/models/release.rb4
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] }