]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/router.rb
Replace alias_method_chain with Module#prepend
[rails.git] / config / initializers / router.rb
index 2987e424af8a5f282df92cb6312207e39dd11049..0987fa0183fb5fd399237857e5e03a05ef54a3b4 100644 (file)
@@ -1,18 +1,14 @@
 # Some versions of ruby seem to accidentally force the encoding
 # as part of normalize_path and some don't
 
-module ActionDispatch
-  module Journey
-    class Router
-      class Utils
-        def self.normalize_path_with_encoding(path)
-          normalize_path_without_encoding(path).force_encoding("UTF-8")
-        end
-
-        class << self
-          alias_method_chain :normalize_path, :encoding
-        end
+module OSM
+  module Router
+    module ForceEncoding
+      def normalize_path(path)
+        super(path).force_encoding("UTF-8")
       end
     end
   end
 end
+
+ActionDispatch::Journey::Router::Utils.singleton_class.prepend(OSM::Router::ForceEncoding)