Permalink
Browse files

Fix called_from under Windows so engines works properly

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
aaronchi authored and josevalim committed Feb 18, 2010
1 parent 7189e3c commit 1477a6101da631a117427a1e53668dfe093a3726
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/engine.rb
@@ -15,7 +15,7 @@ class << self
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

0 comments on commit 1477a61

Please sign in to comment.