Skip to content

Commit

Permalink
Prevent AssetTagHelper from crashing if RAILS_ROOT is not defined. Fi…
Browse files Browse the repository at this point in the history
…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 1f2a4b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions railties/lib/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def logger
end

def root
RAILS_ROOT
if defined?(RAILS_ROOT)
RAILS_ROOT
else
nil
end
end

def env
Expand All @@ -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)
Expand Down

0 comments on commit 1f2a4b3

Please sign in to comment.