From 2801786e1a51b7cf7d7c3fd72b5fc9974f83f435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 1 Aug 2012 20:54:22 +0200 Subject: Get rid of config.preload_frameworks in favor of config.eager_load_namespaces The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly. --- railties/lib/rails/railtie/configuration.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/lib/rails/railtie/configuration.rb') diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb index 1c6b3769a5..9dc8843887 100644 --- a/railties/lib/rails/railtie/configuration.rb +++ b/railties/lib/rails/railtie/configuration.rb @@ -7,6 +7,16 @@ module Rails @@options ||= {} end + # Expose the eager_load_namespaces at "module" level for convenience. + def self.eager_load_namespaces #:nodoc: + @@eager_load_namespaces ||= [] + end + + # All namespaces that are eager loaded + def eager_load_namespaces + @@eager_load_namespaces ||= [] + end + # Add files that should be watched for change. def watchable_files @@watchable_files ||= [] -- cgit v1.2.3