From 1c99baf1f423c835db33bca4335a30fdfda0a0a0 Mon Sep 17 00:00:00 2001 From: Sylvie Daines Date: Tue, 22 Feb 2022 09:57:48 -0600 Subject: [PATCH] Re-add slug uniqueness validation --- app/models/work.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/work.rb b/app/models/work.rb index ab4422d721..21e6cbbb36 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -55,7 +55,7 @@ class Work < ApplicationRecord after_create :alert_intercom validates :title, presence: true, length: { minimum: 3, maximum: 255 } - validates :slug, format: { with: /[[:alpha:]]/ } + validates :slug, uniqueness: { case_sensitive: true }, format: { with: /[[:alpha:]]/ } validate :document_date_is_edtf mount_uploader :picture, PictureUploader