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