From 5dcb4aa8fd6b6671be1c780d5412e8f3ef89c789 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 10 Aug 2022 13:54:14 +0100 Subject: [PATCH] Use member syntax for accessing communities --- lib/osm_community_index.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/osm_community_index.rb b/lib/osm_community_index.rb index baee381d0..2ac318687 100644 --- a/lib/osm_community_index.rb +++ b/lib/osm_community_index.rb @@ -10,12 +10,12 @@ module OsmCommunityIndex data = {} communities.each do |community| - id = community[:id] + id = community.id strings = community_locale_yaml[id] || {} # if the name isn't defined then fall back on community, # as per discussion here: https://github.com/osmlab/osm-community-index/issues/483 - strings["name"] = strings["name"] || community["strings"]["name"] || community["strings"]["community"] + strings["name"] = strings["name"] || community.strings["name"] || community.strings["community"] data.deep_merge!({ "osm_community_index" => { "communities" => { id => strings } } }) end -- 2.39.5