diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-09 14:40:01 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-10 10:13:22 -0700 |
commit | d5fdc0d4480f3558de9d260be26d4c7782ebc781 (patch) | |
tree | 91ffabf06560018f264331eb8a1e7523ec415e9d | |
parent | a50088a4cc4c0575c7fffdf10e0fc3a773485f03 (diff) | |
download | rails-d5fdc0d4480f3558de9d260be26d4c7782ebc781.tar.gz rails-d5fdc0d4480f3558de9d260be26d4c7782ebc781.tar.bz2 rails-d5fdc0d4480f3558de9d260be26d4c7782ebc781.zip |
reduce the number of lambas
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 4ee8cf2457..027b5becf1 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -341,10 +341,7 @@ module ActiveSupport reverse_each do |callback| callbacks = callback.apply(callbacks) end - - lambda { |target, &block| - callbacks.call(target, false, nil, &block)[2] - } + callbacks end def append(*callbacks) @@ -384,7 +381,7 @@ module ActiveSupport str = object.send("_#{kind}_callbacks").compile class_eval do define_method(name) do |&block| - str.call self, &block + str.call(self, false, nil, &block)[2] end protected name end |