Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delegated methods report the expected file/line in backtraces

  • Loading branch information...
commit 50fe928c1539756cb1e3c5e7faf99c2b61979c08 1 parent 5267add
@jeremy jeremy authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 activesupport/lib/active_support/core_ext/module/delegation.rb
View
5 activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -110,10 +110,11 @@ def delegate(*methods)
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
Please sign in to comment.
Something went wrong with that request. Please try again.