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,9 +76,14 @@ module ActiveSupport
|
||||||
# save
|
# save
|
||||||
# end
|
# end
|
||||||
def run_callbacks(kind, &block)
|
def run_callbacks(kind, &block)
|
||||||
runner = send("_#{kind}_callbacks").compile
|
cbs = send("_#{kind}_callbacks")
|
||||||
e = Filters::Environment.new(self, false, nil, block)
|
if cbs.empty?
|
||||||
runner.call(e).value
|
yield if block_given?
|
||||||
|
else
|
||||||
|
runner = cbs.compile
|
||||||
|
e = Filters::Environment.new(self, false, nil, block)
|
||||||
|
runner.call(e).value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue