Permalink
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...
FooBarWidget authored and jeremy committed May 1, 2008
1 parent e2af713 commit 1f2a4b37accc023c96148d54d8daa3a751446c44
Showing with 6 additions and 2 deletions.
  1. +6 −2 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)

0 comments on commit 1f2a4b3

Please sign in to comment.