From fbab7b2acc1db4b8f1a9212350721b7716e74ac8 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 16 Jan 2014 10:45:53 +0100 Subject: Revert "methods are defined right after the module_eval, so we don't need to do" This change breaks tests in activesupport/test/core_ext/module_test.rb: * test_delegation_exception_backtrace * test_delegation_exception_backtrace_with_allow_nil This reverts commit 0167765e3f84260522bc2f32d926c1f5dd44957c. --- activesupport/lib/active_support/core_ext/module/delegation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 7f1f393705..58146cdf7a 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) + module_eval(<<-EOS, file, line - 3) 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) + module_eval(<<-EOS, file, line - 2) def #{method_prefix}#{method}(#{definition}) # def customer_name(*args, &block) _ = #{to} # _ = client _.#{method}(#{definition}) # _.name(*args, &block) -- cgit v1.2.3