review: readability
This commit is contained in:
parent
a3ca79076e
commit
e344b97d51
1 changed files with 3 additions and 2 deletions
|
@ -94,8 +94,9 @@ class Champs::MultipleDropDownListChamp < Champ
|
||||||
end
|
end
|
||||||
|
|
||||||
def values_are_in_options
|
def values_are_in_options
|
||||||
return if (json = JSON.parse(value) - ['']).empty?
|
json = JSON.parse(value).reject(&:blank?)
|
||||||
return if json.filter { |val| enabled_non_empty_options.exclude?(val) }.empty?
|
return if json.empty?
|
||||||
|
return if (json - enabled_non_empty_options).empty?
|
||||||
|
|
||||||
errors.add(:value, :not_in_options)
|
errors.add(:value, :not_in_options)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue