mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-25 08:18:24 -04:00
Validate uniquness of name in the pending queue
This commit is contained in:
1 parent
425e9e07b6
commit
5722bfec59
1 file changed
+1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user