diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-25 10:32:31 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-25 10:32:31 -0700 |
commit | 8e0061128e8946d6e6fab68c078517db668ef050 (patch) | |
tree | 3f25cdb061b8c40e4594f9336a6a18fe79afdbc6 /actionpack/lib | |
parent | 4605b5639db4fa15f8b6627245c74b899241f38a (diff) | |
parent | 4dc42f53539a5d1020c49dd61bad2276adc277bf (diff) | |
download | rails-8e0061128e8946d6e6fab68c078517db668ef050.tar.gz rails-8e0061128e8946d6e6fab68c078517db668ef050.tar.bz2 rails-8e0061128e8946d6e6fab68c078517db668ef050.zip |
Merge pull request #2245 from davidtrogers/constraints_block_passed_to_following_routes_in_same_scope
Memoizing @blocks & disposing of constraints options properly
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 8d071b2061..1331f67a78 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -190,13 +190,12 @@ module ActionDispatch end def blocks - block = @scope[:blocks] || [] - - if @options[:constraints].present? && !@options[:constraints].is_a?(Hash) - block << @options[:constraints] + constraints = @options[:constraints] + if constraints.present? && !constraints.is_a?(Hash) + [constraints] + else + @scope[:blocks] || [] end - - block end def constraints |