public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
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>
Hongli Lai (Phusion (author)
Thu May 01 11:47:09 -0700 2008
jeremy (committer)
Thu May 01 12:45:03 -0700 2008
commit  1f2a4b37accc023c96148d54d8daa3a751446c44
tree    d71e6ccc6c8edbbd2ea07e1aa7fcaac297870466
parent  e2af713d1c71b4f319e5435a63011a7bc23f77c3
...
28
29
30
31
 
 
 
 
 
32
33
34
...
40
41
42
43
 
44
45
46
...
28
29
30
 
31
32
33
34
35
36
37
38
...
44
45
46
 
47
48
49
50
0
@@ -28,7 +28,11 @@ module Rails
0
     end
0
   
0
     def root
0
-      RAILS_ROOT
0
+      if defined?(RAILS_ROOT)
0
+        RAILS_ROOT
0
+      else
0
+        nil
0
+      end
0
     end
0
   
0
     def env
0
@@ -40,7 +44,7 @@ module Rails
0
     end
0
 
0
     def public_path
0
-      @@public_path ||= File.join(self.root, "public")
0
+      @@public_path ||= self.root ? File.join(self.root, "public") : "public"
0
     end
0
 
0
     def public_path=(path)

Comments