diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-06-18 18:06:42 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-06-18 18:07:55 -0400 |
commit | 50fe928c1539756cb1e3c5e7faf99c2b61979c08 (patch) | |
tree | 93062b73d7c0b20f71727ef2c3b7e7d3836c0b22 /activesupport | |
parent | 5267addd4f986c89df3d31f35e046abc3b1fbe26 (diff) | |
download | rails-50fe928c1539756cb1e3c5e7faf99c2b61979c08.tar.gz rails-50fe928c1539756cb1e3c5e7faf99c2b61979c08.tar.bz2 rails-50fe928c1539756cb1e3c5e7faf99c2b61979c08.zip |
Delegated methods report the expected file/line in backtraces
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index a44344806d..cea3fb7f57 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -110,10 +110,11 @@ class Module allow_nil = options[:allow_nil] && "#{to} && " - file, line = caller[0].split(":") + file, line = caller.first.split(':', 2) + line = line.to_i methods.each do |method| - module_eval(<<-EOS, file, line.to_i) + module_eval(<<-EOS, file, line) def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block) #{allow_nil}#{to}.__send__(#{method.inspect}, *args, &block) # client && client.__send__(:name, *args, &block) end # end |