review: use selected options

Co-authored-by: Paul Chavard <paul.chavard@beta.gouv.fr>
This commit is contained in:
Sébastien Carceles 2023-02-15 12:17:28 +01:00 committed by sebastiencarceles
parent e344b97d51
commit 8c67df7130

View file

@ -94,7 +94,7 @@ class Champs::MultipleDropDownListChamp < Champ
end end
def values_are_in_options def values_are_in_options
json = JSON.parse(value).reject(&:blank?) json = selected_options.reject(&:blank?)
return if json.empty? return if json.empty?
return if (json - enabled_non_empty_options).empty? return if (json - enabled_non_empty_options).empty?