15258: Adds /lib to the eager_load paths.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 22 May 2019 19:57:19 +0000 (16:57 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 22 May 2019 19:57:19 +0000 (16:57 -0300)
On rails 5.0 the autoload paths stopped working on production environments
for thread safety concerns.
See: https://github.com/rails/rails/commit/a71350cae0082193ad8c66d65ab62e8bb0b7853b

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/config/application.rb

index 09fa403057aa996c66ea0ce530315c4c3a6347f2..c8a722f0bfff06b107a83a198aee5a79755877c1 100644 (file)
@@ -27,7 +27,13 @@ module ArvadosWorkbench
 
     # Custom directories with classes and modules you want to be autoloadable.
     # config.autoload_paths += %W(#{config.root}/extras)
-    config.autoload_paths += %W(#{config.root}/lib)
+
+    # Autoload paths shouldn't be used anymore since Rails 5.0
+    # See #15258 and https://github.com/rails/rails/issues/13142#issuecomment-74586224
+    config.eager_load_paths += %W(#{config.root}/lib)
+
+    # Load entire application at startup.
+    config.eager_load = true
 
     # Only load the plugins named here, in the order given (default is alphabetical).
     # :all can be used as a placeholder for all plugins not explicitly named.