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

if there is nothing to compile, then do not bother compiling

This commit is contained in:
Aaron Patterson 2013-05-13 16:43:27 -07:00
parent 877964dc61
commit ccbefff684

View file

@ -76,10 +76,15 @@ module ActiveSupport
# save
# end
def run_callbacks(kind, &block)
runner = send("_#{kind}_callbacks").compile
cbs = send("_#{kind}_callbacks")
if cbs.empty?
yield if block_given?
else
runner = cbs.compile
e = Filters::Environment.new(self, false, nil, block)
runner.call(e).value
end
end
private