]> git.openstreetmap.org Git - rails.git/commitdiff
Use Pathname.glob to fetch the files
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Nov 2022 18:33:32 +0000 (18:33 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Nov 2022 18:33:32 +0000 (18:33 +0000)
lib/osm_community_index.rb

index fb3d7b28ed656be537ec44303d0fda3b566ad234..ca9d2d3b3bb5cee059b263f45804d7e0c99cbbd7 100644 (file)
@@ -3,7 +3,7 @@ module OsmCommunityIndex
     # Filter the communities here to avoid loading excessive numbers of translations
     communities = Community.where(:type => "osm-lc").where.not(:id => "OSMF")
 
-    files = Dir.glob(Rails.root.join("node_modules/osm-community-index/i18n/*.yaml"))
+    files = Rails.root.glob("node_modules/osm-community-index/i18n/*.yaml")
     files.each do |file|
       locale = File.basename(file, ".yaml")
       community_locale_yaml = YAML.safe_load(File.read(file))[locale]