Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevent AssetTagHelper from crashing if RAILS_ROOT is not defined. Fi…

…xes compatibility with Passenger. [#84 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 1f2a4b37accc023c96148d54d8daa3a751446c44 1 parent e2af713
@FooBarWidget FooBarWidget authored jeremy committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 railties/lib/initializer.rb
View
8 railties/lib/initializer.rb
@@ -28,7 +28,11 @@ def logger
end
def root
- RAILS_ROOT
+ if defined?(RAILS_ROOT)
+ RAILS_ROOT
+ else
+ nil
+ end
end
def env
@@ -40,7 +44,7 @@ def cache
end
def public_path
- @@public_path ||= File.join(self.root, "public")
+ @@public_path ||= self.root ? File.join(self.root, "public") : "public"
end
def public_path=(path)
Please sign in to comment.
Something went wrong with that request. Please try again.