Better handle empty user selection layers

This commit is contained in:
Paul Chavard 2018-10-22 14:17:30 +02:00
parent 4249f8ae25
commit c8c75fc254
4 changed files with 21 additions and 4 deletions

View file

@ -17,7 +17,16 @@ class Champ < ApplicationRecord
end
def mandatory_and_blank?
mandatory? && value.blank?
if mandatory?
case type_de_champ.type_champ
when TypeDeChamp.type_champs.fetch(:carte)
value.blank? || value == '[]'
else
value.blank?
end
else
false
end
end
def search_terms