From 2b1d7ea335afa46fa167a680492cdf5461c46064 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 May 2013 14:47:17 -0700 Subject: [PATCH] fix variable name --- activesupport/lib/active_support/callbacks.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 027b5becf1..328db8c890 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -169,7 +169,7 @@ def recompile!(_options) end # Wraps code with filter - def apply(code) + def apply(next_callback) conditions = conditions_lambdas source = make_lambda @raw_filter @@ -184,12 +184,12 @@ def apply(code) target.send :halted_callback_hook, @raw_filter.inspect end end - code.call target, halted, value, &block + next_callback.call target, halted, value, &block } when :after if chain.config[:skip_after_callbacks_if_terminated] lambda { |target, halted, value, &block| - target, halted, value = code.call target, halted, value, &block + target, halted, value = next_callback.call target, halted, value, &block if !halted && conditions.all? { |c| c.call(target, value) } source.call target, value end @@ -197,7 +197,7 @@ def apply(code) } else lambda { |target, halted, value, &block| - target, halted, value = code.call target, halted, value, &block + target, halted, value = next_callback.call target, halted, value, &block if conditions.all? { |c| c.call(target, value) } source.call target, value end @@ -209,12 +209,12 @@ def apply(code) if !halted && conditions.all? { |c| c.call(target, value) } retval = nil source.call(target, value) { - retval = code.call(target, halted, value, &block) + retval = next_callback.call(target, halted, value, &block) retval.last } retval else - code.call target, halted, value, &block + next_callback.call target, halted, value, &block end } end