1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

halting lambda must be instance execed

This commit is contained in:
Aaron Patterson 2013-05-14 14:08:39 -07:00
parent dbee8c3258
commit def815a461

View file

@ -131,7 +131,7 @@ module ActiveSupport
if !halted && user_conditions.all? { |c| c.call(target, value) } if !halted && user_conditions.all? { |c| c.call(target, value) }
result = user_callback.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 if env.halted
target.send :halted_callback_hook, filter target.send :halted_callback_hook, filter
end end
@ -148,7 +148,7 @@ module ActiveSupport
if !halted if !halted
result = user_callback.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 if env.halted
target.send :halted_callback_hook, filter target.send :halted_callback_hook, filter
end end