aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-01-15 16:06:56 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-01-15 16:07:12 -0800
commit0167765e3f84260522bc2f32d926c1f5dd44957c (patch)
tree00f29c471fe12109b03885b84bf654931846dfa5 /activesupport/lib
parentf2f723bca931c368bf9391b46c57ffd98c6b4fa5 (diff)
downloadrails-0167765e3f84260522bc2f32d926c1f5dd44957c.tar.gz
rails-0167765e3f84260522bc2f32d926c1f5dd44957c.tar.bz2
rails-0167765e3f84260522bc2f32d926c1f5dd44957c.zip
methods are defined right after the module_eval, so we don't need to do
any line number maths
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb4
1 files changed, 2 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 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)