1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix called_from under Windows so engines works properly

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Aaron 2010-02-18 09:21:01 -08:00 committed by José Valim
parent 7189e3c881
commit 1477a6101d

View file

@ -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