aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r--railties/lib/rails/application.rb25
1 files changed, 7 insertions, 18 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 498fd6a723..d83c65da8d 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -9,7 +9,13 @@ module Rails
end
def new
- @instance ||= super
+ @instance ||= begin
+ begin
+ require config.environment_path
+ rescue LoadError
+ end
+ super
+ end
end
def config
@@ -119,23 +125,6 @@ module Rails
@app.call(env)
end
-
- # Loads the environment specified by Configuration#environment_path, which
- # is typically one of development, test, or production.
- initializer :load_environment do
- next unless File.file?(config.environment_path)
-
- config = self.config
-
- Kernel.class_eval do
- meth = instance_method(:config) if Object.respond_to?(:config)
- define_method(:config) { config }
- require config.environment_path
- remove_method :config
- define_method(:config, &meth) if meth
- end
- end
-
# Set the <tt>$LOAD_PATH</tt> based on the value of
# Configuration#load_paths. Duplicates are removed.
initializer :set_load_path do