From 0167765e3f84260522bc2f32d926c1f5dd44957c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 15 Jan 2014 16:06:56 -0800 Subject: methods are defined right after the module_eval, so we don't need to do any line number maths --- activesupport/lib/active_support/core_ext/module/delegation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb') diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 58146cdf7a..7f1f393705 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -178,7 +178,7 @@ class Module # whereas conceptually, from the user point of view, the delegator should # be doing one call. if allow_nil - module_eval(<<-EOS, file, line - 3) + module_eval(<<-EOS, file, line) def #{method_prefix}#{method}(#{definition}) # def customer_name(*args, &block) _ = #{to} # _ = client if !_.nil? || nil.respond_to?(:#{method}) # if !_.nil? || nil.respond_to?(:name) @@ -189,7 +189,7 @@ class Module else exception = %(raise DelegationError, "#{self}##{method_prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \#{self.inspect}") - module_eval(<<-EOS, file, line - 2) + module_eval(<<-EOS, file, line) def #{method_prefix}#{method}(#{definition}) # def customer_name(*args, &block) _ = #{to} # _ = client _.#{method}(#{definition}) # _.name(*args, &block) -- cgit v1.2.3