diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2010-01-02 22:49:40 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2010-01-02 22:49:40 -0800 |
commit | 106d8f76888e76096f83e884f55dbcd536a0c1d7 (patch) | |
tree | 4127758273beb4b8e91a4e514b057081a1437527 | |
parent | f1cd3a98f3c2ff3446c637ad706faf7dbfef268e (diff) | |
download | rails-106d8f76888e76096f83e884f55dbcd536a0c1d7.tar.gz rails-106d8f76888e76096f83e884f55dbcd536a0c1d7.tar.bz2 rails-106d8f76888e76096f83e884f55dbcd536a0c1d7.zip |
AppName::Application.root should work
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 26ffbe5a58..5401251397 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -8,7 +8,7 @@ module Rails class << self attr_writer :config alias configure class_eval - delegate :initialize!, :load_tasks, :to => :instance + delegate :initialize!, :load_tasks, :root, :to => :instance private :new def instance diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index adb867ca6d..79dfacdcdb 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -24,6 +24,11 @@ module ApplicationTests assert_equal Pathname.new(app_path), Rails.application.root end + test "the application root can be seen from the application singleton" do + require "#{app_path}/config/environment" + assert_equal Pathname.new(app_path), AppTemplate::Application.root + end + test "the application root can be set" do copy_app add_to_config <<-RUBY |