Permalink
Browse files

no need for variable assignments, just pass the values in

  • Loading branch information...
1 parent f5478d9 commit 6514ee9044f94a3e4dae01297103bbd354acc221 @tenderlove tenderlove committed May 9, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 activesupport/lib/active_support/callbacks.rb
@@ -255,9 +255,7 @@ def invert_lambda(l)
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 @@ def compile
end
lambda { |target, &block|
- value = nil
- halted = false
- callbacks.call(target, halted, value, &block)[2]
+ callbacks.call(target, false, nil, &block)[2]
}
end

0 comments on commit 6514ee9

Please sign in to comment.