]> git.openstreetmap.org Git - rails.git/blobdiff - lib/country.rb
Switch to canonical-rails from master, with rails 7.2.1+ compatibility
[rails.git] / lib / country.rb
index ab88072ecd048d9b86faadcc198f653ae29ffc98..ca547a972d7df72ccb9bd9c6dc03823b648ee50e 100644 (file)
@@ -19,7 +19,7 @@ class Country
 
   def self.load_countries
     countries = {}
 
   def self.load_countries
     countries = {}
-    xml = REXML::Document.new(File.read(Rails.root.join("config", "countries.xml")))
+    xml = REXML::Document.new(Rails.root.join("config/countries.xml").read)
 
     xml.elements.each("geonames/country") do |ele|
       code = ele.get_text("countryCode").to_s
 
     xml.elements.each("geonames/country") do |ele|
       code = ele.get_text("countryCode").to_s