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

avoid method call to compact

This commit is contained in:
Aaron Patterson 2010-10-04 16:08:01 -07:00
parent e7d860c6be
commit 28bb1885f5

View file

@ -171,13 +171,13 @@ module ActionDispatch
end
def blocks
block = @scope[:blocks] || []
if @options[:constraints].present? && !@options[:constraints].is_a?(Hash)
block = @options[:constraints]
else
block = nil
block << @options[:constraints]
end
((@scope[:blocks] || []) + [ block ]).compact
block
end
def constraints