Validate uniquness of name in the pending queue

This commit is contained in:
Daniel O'Connor committed 2023-03-13 07:58:11 +00:00
1 parent 425e9e07b6
commit 5722bfec59
1 file changed
+1
+1
View File
@@ -54,6 +54,7 @@ class Crop < ApplicationRecord
message: 'is not a valid English Wikipedia URL'
},
if: :approved?
validates :name, uniqueness: { scope: :approval_status }, if: :pending?
def to_s
name