]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Fix new rubocop warnings
[rails.git] / app / controllers / geocoder_controller.rb
index 43f276efa020a35cfdbb1719155c4a3f5e61c1fe..85b4476f6d4f2d620b65a4244bb23e7b0b458a20 100644 (file)
@@ -101,8 +101,9 @@ class GeocoderController < ApplicationController
       if klass == "boundary" && type == "administrative"
         rank = (place.attributes["address_rank"].to_i + 1) / 2
         prefix_name = t "geocoder.search_osm_nominatim.admin_levels.level#{rank}", :default => prefix_name
+        place_tags = %w[linked_place place]
         place.elements["extratags"].elements.each("tag") do |extratag|
-          prefix_name = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "linked_place" || extratag.attributes["key"] == "place"
+          prefix_name = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if place_tags.include?(extratag.attributes["key"])
         end
       end
       prefix = t ".prefix_format", :name => prefix_name