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

reduce the number of lambas

This commit is contained in:
Aaron Patterson 2013-05-09 14:40:01 -07:00
parent a50088a4cc
commit d5fdc0d448

View file

@ -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