diff options
author | Alexander Mankuta <cheba@pointlessone.org> | 2014-11-26 13:47:09 +0200 |
---|---|---|
committer | Alexander Mankuta <cheba@pointlessone.org> | 2014-11-26 13:47:09 +0200 |
commit | f2b17231bacbbc437f64b51b386b3eea06c65c84 (patch) | |
tree | bb2c90823db0b01ef87573e8c5786ac86ca84170 | |
parent | 73a7192394ad628b91894b18f77ab31de628ba5b (diff) | |
download | rails-f2b17231bacbbc437f64b51b386b3eea06c65c84.tar.gz rails-f2b17231bacbbc437f64b51b386b3eea06c65c84.tar.bz2 rails-f2b17231bacbbc437f64b51b386b3eea06c65c84.zip |
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.
-rw-r--r-- | railties/lib/rails/engine.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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+.*/, '') } |