no fallar si el articulo no tenia metadatos geo

This commit is contained in:
f 2020-05-12 10:11:10 -03:00
parent 86ffed3794
commit ddd9c4a0ac

View file

@ -7,7 +7,7 @@ class MetadataGeo < MetadataTemplate
end end
def empty? def empty?
value == default_value self[:value].nil? || value == default_value
end end
def to_param def to_param
@ -15,9 +15,13 @@ class MetadataGeo < MetadataTemplate
end end
def save def save
return true if empty?
self[:value] = { self[:value] = {
'lat' => self[:value]['lat'].to_f, 'lat' => self[:value]['lat'].to_f,
'lng' => self[:value]['lng'].to_f 'lng' => self[:value]['lng'].to_f
} }
true
end end
end end