mirror of https://github.com/rails/rails
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:
parent
e2af713d1c
commit
1f2a4b37ac
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue