Better handle empty user selection layers
This commit is contained in:
parent
4249f8ae25
commit
c8c75fc254
4 changed files with 21 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue