From def815a4615817acf49fed289a87aa0debb6a4ea Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 May 2013 14:08:39 -0700 Subject: [PATCH] halting lambda must be instance execed --- activesupport/lib/active_support/callbacks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index d2a545b6d4..5b8a300528 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -131,7 +131,7 @@ def self.halting_and_conditional(next_callback, user_callback, user_conditions, if !halted && user_conditions.all? { |c| c.call(target, value) } result = user_callback.call target, value - env.halted = halted_lambda.call result + env.halted = target.instance_exec result, &halted_lambda if env.halted target.send :halted_callback_hook, filter end @@ -148,7 +148,7 @@ def self.halting(next_callback, user_callback, halted_lambda, filter) if !halted result = user_callback.call target, value - env.halted = halted_lambda.call result + env.halted = target.instance_exec result, &halted_lambda if env.halted target.send :halted_callback_hook, filter end -- GitLab