From 1c121923019c8a5c0ec8d314c3aeb95abd71e4fa Mon Sep 17 00:00:00 2001 From: Antti Hukkanen Date: Fri, 5 Apr 2024 17:28:05 +0300 Subject: [PATCH] Fix display issue when a scope coordinate is not set --- app/models/decidim/ideas/idea.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/decidim/ideas/idea.rb b/app/models/decidim/ideas/idea.rb index 80ce5c3..957d6b7 100644 --- a/app/models/decidim/ideas/idea.rb +++ b/app/models/decidim/ideas/idea.rb @@ -159,14 +159,11 @@ def self.geocoded_data_for(component) end def self.area_scope_coordinates_for(component) - component.settings.area_scope_coordinates.to_h do |scope_id, coords| + component.settings.area_scope_coordinates.index_with do |(_scope_id, coords)| latlng = coords.split(",") next if latlng.length < 2 - [ - scope_id.to_s.to_i, - [latlng[0].to_f, latlng[1].to_f] - ] + [latlng[0].to_f, latlng[1].to_f] end.compact end