]> git.openstreetmap.org Git - rails.git/commitdiff
Use member syntax for accessing communities
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 12:54:14 +0000 (13:54 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 12:54:14 +0000 (13:54 +0100)
lib/osm_community_index.rb

index baee381d0f75a1ddbd40a1ec1e189e502cb62c31..2ac3186871f60b6208c83932cf1b533794806df0 100644 (file)
@@ -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