From 6514ee9044f94a3e4dae01297103bbd354acc221 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 May 2013 12:06:47 -0700 Subject: no need for variable assignments, just pass the values in --- activesupport/lib/active_support/callbacks.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index d869770489..ca6937eeb3 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -255,9 +255,7 @@ module ActiveSupport def make_lambda(filter) case filter when Symbol - lambda { |target, value, &blk| - target.send filter, &blk - } + lambda { |target, value, &blk| target.send filter, &blk } when String l = eval "lambda { |value| #{filter} }" lambda { |target,value| target.instance_exec(value, &l) } @@ -351,9 +349,7 @@ module ActiveSupport end lambda { |target, &block| - value = nil - halted = false - callbacks.call(target, halted, value, &block)[2] + callbacks.call(target, false, nil, &block)[2] } end -- cgit v1.2.3