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:
parent
877964dc61
commit
ccbefff684
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue