diff options
author | Aaron <aaronchi@gmail.com> | 2010-02-18 09:21:01 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-18 18:36:55 +0100 |
commit | 1477a6101da631a117427a1e53668dfe093a3726 (patch) | |
tree | 8192f50519c030cbbe6e69c7f1b9f14886580027 /railties | |
parent | 7189e3c8816ea4dc88c09bdd109c4a503fc5c4dc (diff) | |
download | rails-1477a6101da631a117427a1e53668dfe093a3726.tar.gz rails-1477a6101da631a117427a1e53668dfe093a3726.tar.bz2 rails-1477a6101da631a117427a1e53668dfe093a3726.zip |
Fix called_from under Windows so engines works properly
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-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 53e54d7400..a158bb7b70 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -15,7 +15,7 @@ module Rails def inherited(base) unless abstract_railtie?(base) base.called_from = begin - call_stack = caller.map { |p| p.split(':').first } + call_stack = caller.map { |p| p.split(':')[0..-2].join(':') } File.dirname(call_stack.detect { |p| p !~ %r[railties[\w\-]*/lib/rails|rack[\w\-]*/lib/rack] }) end end |