Properly validate Procedure.lien_site_web is set when publishing

This commit is contained in:
Nicolas Bouilleaud 2019-07-29 16:01:13 +02:00
parent 00c37eccb3
commit 8806eab8d6

View file

@ -64,6 +64,7 @@ class Procedure < ApplicationRecord
validates :libelle, presence: true, allow_blank: false, allow_nil: false
validates :description, presence: true, allow_blank: false, allow_nil: false
validates :administrateurs, presence: true
validates :lien_site_web, presence: true, if: :publiee?
validate :check_juridique
validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,50}\z/ }, uniqueness: { scope: [:path, :archived_at, :hidden_at], case_sensitive: false }
# FIXME: remove duree_conservation_required flag once all procedures are converted to the new style