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:
parent
e7d860c6be
commit
28bb1885f5
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue