diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 2143504b338f3..86a31f1fbdeda 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add Rails.logger, Rails.root, Rails.env and Rails.cache shortcuts for RAILS_* constants [pratik] + * Allow files in plugins to be reloaded like the rest of the application. [rick] Enables or disables plugin reloading. diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 40c2ad90cbf2a..d2c61b8dc9688 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -22,6 +22,22 @@ def self.configuration=(configuration) @@configuration = configuration end + def self.logger + RAILS_DEFAULT_LOGGER + end + + def self.root + RAILS_ROOT + end + + def self.env + RAILS_ENV + end + + def self.cache + RAILS_CACHE + end + # The Initializer is responsible for processing the Rails configuration, such # as setting the $LOAD_PATH, requiring the right frameworks, initializing # logging, and more. It can be run either as a single command that'll just