diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-09 12:06:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-10 10:13:22 -0700 |
commit | 6514ee9044f94a3e4dae01297103bbd354acc221 (patch) | |
tree | 385911b061c0d7ec6d39d22501f6e98515decd29 | |
parent | f5478d9263e9aa036a09199be7a5fe0644e02031 (diff) | |
download | rails-6514ee9044f94a3e4dae01297103bbd354acc221.tar.gz rails-6514ee9044f94a3e4dae01297103bbd354acc221.tar.bz2 rails-6514ee9044f94a3e4dae01297103bbd354acc221.zip |
no need for variable assignments, just pass the values in
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 8 |
1 files changed, 2 insertions, 6 deletions
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 |