5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-01 22:26:06 +00:00

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