diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-21 16:03:20 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-21 16:03:26 -0800 |
commit | b0b4ae970c1cb586235bcfbc669d43475c7fe684 (patch) | |
tree | c9d313351860bb7d63676b6bbd6e69de5bd78a10 /railties/lib/rails/application.rb | |
parent | a110ff0fca45c6cc74c0da5d8dcdabeed43e78b1 (diff) | |
download | rails-b0b4ae970c1cb586235bcfbc669d43475c7fe684.tar.gz rails-b0b4ae970c1cb586235bcfbc669d43475c7fe684.tar.bz2 rails-b0b4ae970c1cb586235bcfbc669d43475c7fe684.zip |
test.rb, dev.rb, and production.rb just reopen the Application class; no more hax required
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 25 |
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 |