diff options
author | Hongli Lai (Phusion <hongli@phusion.nl> | 2008-05-01 20:47:09 +0200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-05-01 12:45:03 -0700 |
commit | 1f2a4b37accc023c96148d54d8daa3a751446c44 (patch) | |
tree | d71e6ccc6c8edbbd2ea07e1aa7fcaac297870466 /railties | |
parent | e2af713d1c71b4f319e5435a63011a7bc23f77c3 (diff) | |
download | rails-1f2a4b37accc023c96148d54d8daa3a751446c44.tar.gz rails-1f2a4b37accc023c96148d54d8daa3a751446c44.tar.bz2 rails-1f2a4b37accc023c96148d54d8daa3a751446c44.zip |
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>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index ea61d4e4fe..09a98d5aa3 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -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) |