Prevent AssetTagHelper from crashing if RAILS_ROOT is not defined. Fixes compatibility with Passenger. [#84 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Hongli Lai (Phusion 2008-05-01 20:47:09 +02:00 committed by Jeremy Kemper
parent e2af713d1c
commit 1f2a4b37ac
1 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,11 @@ module Rails
end
def root
RAILS_ROOT
if defined?(RAILS_ROOT)
RAILS_ROOT
else
nil
end
end
def env
@ -40,7 +44,7 @@ module Rails
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)