diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-04 16:08:01 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-04 16:08:01 -0700 |
commit | 28bb1885f5a35d0adecd35d38b73751d737891c4 (patch) | |
tree | bf4e4a4296ef418961f00020f2e6d8476f2b79ac /actionpack/lib/action_dispatch/routing | |
parent | e7d860c6bed99b0d44680097fcc1cfd7c1fa07ef (diff) | |
download | rails-28bb1885f5a35d0adecd35d38b73751d737891c4.tar.gz rails-28bb1885f5a35d0adecd35d38b73751d737891c4.tar.bz2 rails-28bb1885f5a35d0adecd35d38b73751d737891c4.zip |
avoid method call to compact
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 47aed0273c..bf10f81127 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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 |