diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-30 17:19:01 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-30 17:19:01 +0000 |
commit | 5b38d8557122723aa7c11c28d4c2c93464982766 (patch) | |
tree | d7ef5df5d7121f31e897ddeac94dbda64fa44833 /railties/environments/shared.rb | |
parent | 38e5fe97be08109fb8a416238ff8e3aaacbfc703 (diff) | |
download | rails-5b38d8557122723aa7c11c28d4c2c93464982766.tar.gz rails-5b38d8557122723aa7c11c28d4c2c93464982766.tar.bz2 rails-5b38d8557122723aa7c11c28d4c2c93464982766.zip |
AbstractApplicationController and the individual controllers are now completely reloaded on each request if "reload_dependencies" is set to true. This makes it possible to REMOVE methods and constants and have the changes reflected. Beaware that this is still not possible for models, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@31 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/environments/shared.rb')
-rw-r--r-- | railties/environments/shared.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/railties/environments/shared.rb b/railties/environments/shared.rb index 78628341e8..0e30f1368b 100644 --- a/railties/environments/shared.rb +++ b/railties/environments/shared.rb @@ -6,14 +6,14 @@ RAILS_ENV = ENV['RAILS_ENV'] || 'development' ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"] # Then model subdirectories. -ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[a-z]*"]) +ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"]) # Followed by the standard includes. ADDITIONAL_LOAD_PATHS.concat %w( + app app/models app/controllers app/helpers - app config lib vendor @@ -25,9 +25,7 @@ ADDITIONAL_LOAD_PATHS.concat %w( ).map { |dir| "#{RAILS_ROOT}/#{dir}" } # Prepend to $LOAD_PATH -ADDITIONAL_LOAD_PATHS.reverse.each do |dir| - $:.unshift(dir) if File.directory?(dir) -end +ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } # Require Rails libraries. @@ -37,12 +35,10 @@ require 'action_mailer' # Environment-specific configuration. +ActionController::Base.require_or_load "environments/#{RAILS_ENV}" ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml")) ActiveRecord::Base.establish_connection -ActionController::Base.require_or_load 'abstract_application' -ActionController::Base.require_or_load "environments/#{RAILS_ENV}" - # Configure defaults if the included environment did not. RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log") @@ -53,4 +49,5 @@ end klass.template_root ||= "#{RAILS_ROOT}/app/views/" end + # Include your app's configuration here: |