mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 01:13:03 -04:00
Merge pull request #3282 from Growstuff/issues/3269
Crop Requests: Validate uniquness of name in the pending queue
This commit is contained in:
@@ -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