hacer más claro el código

This commit is contained in:
f 2021-10-21 10:48:34 -03:00
parent 090b630525
commit d67d43ff1e

View file

@ -25,10 +25,14 @@ class MetadataBoolean < MetadataTemplate
# * false
# * true
def value
return document.data.fetch(name.to_s, default_value) if self[:value].nil?
return self[:value] unless self[:value].is_a? String
self[:value] = true_values.include? self[:value]
case self[:value]
when NilClass
document.data.fetch(name.to_s, default_value)
when String
true_values.include? self[:value]
else
self[:value]
end
end
# Siempre guardar el valor de este campo a menos que sea nulo