no fallar si el articulo no tenia metadatos geo
This commit is contained in:
parent
86ffed3794
commit
ddd9c4a0ac
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue