]> git.openstreetmap.org Git - rails.git/commitdiff
Move monkey patch modules to the OpenStreetMap namespace
authorTom Hughes <tom@compton.nu>
Fri, 2 Jun 2017 14:38:45 +0000 (15:38 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 2 Jun 2017 15:33:27 +0000 (16:33 +0100)
Having them in the OSM namespace risks blocking autoloading
of the lib/osm.rb code by defining the OSM constant.

config/initializers/abstract_adapter.rb
config/initializers/i18n.rb
config/initializers/router.rb
lib/migrate.rb

index 290e2493d943c26470eb54d6e2a2b49f28041b5d..2bc4f5e59d40d07f552d36417bd3f211eda8d6ee 100644 (file)
@@ -1,5 +1,5 @@
 if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdapter)
 if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdapter)
-  module OSM
+  module OpenStreetMap
     module AbstractAdapter
       module PropagateTimeouts
         def translate_exception_class(e, sql)
     module AbstractAdapter
       module PropagateTimeouts
         def translate_exception_class(e, sql)
@@ -13,5 +13,5 @@ if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdapter)
     end
   end
 
     end
   end
 
-  ActiveRecord::ConnectionAdaptors::AbstractAdapter.prepend(OSM::AbstractAdapter::PropagateTimeouts)
+  ActiveRecord::ConnectionAdaptors::AbstractAdapter.prepend(OpenStreetMap::AbstractAdapter::PropagateTimeouts)
 end
 end
index fff69378baf7246fda9e65fda0737fdebcb9479b..89ff677fb2c4aeacd53ebf06ae9cca24ffa02bd4 100644 (file)
@@ -11,7 +11,7 @@ module I18n
   end
 end
 
   end
 end
 
-module OSM
+module OpenStreetMap
   module I18n
     module NormaliseLocales
       def store_translations(locale, data, options = {})
   module I18n
     module NormaliseLocales
       def store_translations(locale, data, options = {})
@@ -31,8 +31,8 @@ module OSM
   end
 end
 
   end
 end
 
-I18n::Backend::Simple.prepend(OSM::I18n::NormaliseLocales)
-I18n::JS::FallbackLocales.prepend(OSM::I18n::ValidateLocales)
+I18n::Backend::Simple.prepend(OpenStreetMap::I18n::NormaliseLocales)
+I18n::JS::FallbackLocales.prepend(OpenStreetMap::I18n::ValidateLocales)
 
 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
 
 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
index 0987fa0183fb5fd399237857e5e03a05ef54a3b4..4357a87f25f47ea0cc98c8da6d9f155ed8dad750 100644 (file)
@@ -1,7 +1,7 @@
 # Some versions of ruby seem to accidentally force the encoding
 # as part of normalize_path and some don't
 
 # Some versions of ruby seem to accidentally force the encoding
 # as part of normalize_path and some don't
 
-module OSM
+module OpenStreetMap
   module Router
     module ForceEncoding
       def normalize_path(path)
   module Router
     module ForceEncoding
       def normalize_path(path)
@@ -11,4 +11,4 @@ module OSM
   end
 end
 
   end
 end
 
-ActionDispatch::Journey::Router::Utils.singleton_class.prepend(OSM::Router::ForceEncoding)
+ActionDispatch::Journey::Router::Utils.singleton_class.prepend(OpenStreetMap::Router::ForceEncoding)
index b16fa523c20a3de7255b891fb3dff4b0c9e418c9..182a2a08614485ef690590bcb940e21849ce671a 100644 (file)
@@ -1,4 +1,4 @@
-module OSM
+module OpenStreetMap
   module ActiveRecord
     module AbstractAdapter
       def add_index_options(table_name, column_name, options = {})
   module ActiveRecord
     module AbstractAdapter
       def add_index_options(table_name, column_name, options = {})
@@ -41,5 +41,5 @@ module OSM
   end
 end
 
   end
 end
 
-ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(OSM::ActiveRecord::AbstractAdapter)
-ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(OSM::ActiveRecord::PostgreSQLAdapter)
+ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(OpenStreetMap::ActiveRecord::AbstractAdapter)
+ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(OpenStreetMap::ActiveRecord::PostgreSQLAdapter)