Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AppName::Application.root should work

  • Loading branch information...
commit 106d8f76888e76096f83e884f55dbcd536a0c1d7 1 parent f1cd3a9
Yehuda Katz authored
View
2  railties/lib/rails/application.rb
@@ -8,7 +8,7 @@ class Application
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
View
5 railties/test/application/configuration_test.rb
@@ -24,6 +24,11 @@ def setup
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
Please sign in to comment.
Something went wrong with that request. Please try again.