5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 02:31:42 +00:00

no perder las coordenadas al guardar!

This commit is contained in:
f 2020-06-09 15:49:14 -03:00
parent ea5b7ae9d2
commit 3300e65022

View file

@ -7,7 +7,7 @@ class MetadataGeo < MetadataTemplate
end
def empty?
self[:value].nil? || value == default_value
value == default_value
end
def to_param
@ -17,10 +17,7 @@ class MetadataGeo < MetadataTemplate
def save
return true if empty?
self[:value] = {
'lat' => self[:value]['lat'].to_f,
'lng' => self[:value]['lng'].to_f
}
self[:value] = value.transform_values(&:to_f)
true
end