4 def self.local_chapters
5 @local_chapters ||= self.load_local_chapters
10 def self.load_local_chapters
12 json_file = File.expand_path("node_modules/osm-community-index/dist/completeFeatureCollection.json", Dir.pwd);
13 community_index = JSON.parse(File.read(json_file))
16 community_index['features'].each do |feature|
17 feature['properties']['resources'].each do |id, data|
18 data.each do |key, value|
19 if key == "type" and value == "osm-lc" and data['strings']['community']
20 local_chapters.push({ id: id, name: data['strings']['community'], url: data['strings']['url'] });