summaryrefslogtreecommitdiff
path: root/app/models/releases
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-08 19:14:05 +0900
committerShinya Maeda <shinya@gitlab.com>2019-01-09 14:40:38 +0900
commit50768a25ece480f48729985ad0f606ac73eb23fe (patch)
tree7ff0aeb6aa3c75c7cad1814b3b9b29447ae8e87c /app/models/releases
parentba5a9033cfefe72897c7e0e13950011a9dee8e80 (diff)
downloadgitlab-ce-50768a25ece480f48729985ad0f606ac73eb23fe.tar.gz
Add uniqueness validation to url column in Releases::Link model
Add test Add changelog
Diffstat (limited to 'app/models/releases')
-rw-r--r--app/models/releases/link.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/releases/link.rb b/app/models/releases/link.rb
index 766cb2efff2..6f639e5a7b2 100644
--- a/app/models/releases/link.rb
+++ b/app/models/releases/link.rb
@@ -6,7 +6,7 @@ module Releases
belongs_to :release
- validates :url, presence: true, url: true
+ validates :url, presence: true, url: true, uniqueness: { scope: :release }
validates :name, presence: true, uniqueness: { scope: :release }
scope :sorted, -> { order(created_at: :desc) }