Permalink
Browse files

Update rails application root detection to take into consideration a …

…callstack that includes the rack library
  • Loading branch information...
1 parent c102db9 commit 58dec093536e63e61a9d69341da539048367f5e1 Carlhuda committed Nov 24, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/configuration.rb
@@ -31,7 +31,7 @@ def after_initialize(&blk)
def root
@root ||= begin
call_stack = caller.map { |p| p.split(':').first }
- root_path = call_stack.detect { |p| p !~ %r[railties/lib/rails] }
+ root_path = call_stack.detect { |p| p !~ %r[railties/lib/rails|rack/lib/rack] }
root_path = File.dirname(root_path)
while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/config.ru")

0 comments on commit 58dec09

Please sign in to comment.