Skip to content

Commit

Permalink
Fix display issue when a scope coordinate is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Apr 5, 2024
1 parent c72ee3d commit 1c12192
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/models/decidim/ideas/idea.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1c12192

Please sign in to comment.