From f2b17231bacbbc437f64b51b386b3eea06c65c84 Mon Sep 17 00:00:00 2001 From: Alexander Mankuta Date: Wed, 26 Nov 2014 13:47:09 +0200 Subject: Use absolute_path of caller_locations to infer engine root According to documentation `path` only returns file names. On MRI it's not the case but it's likely a bug in MRI. --- railties/lib/rails/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 023ea98145..4b7da32208 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -351,7 +351,7 @@ module Rails base.called_from = begin call_stack = if Kernel.respond_to?(:caller_locations) - caller_locations.map(&:path) + caller_locations.map(&:absolute_path) else # Remove the line number from backtraces making sure we don't leave anything behind caller.map { |p| p.sub(/:\d+.*/, '') } -- cgit v1.2.3