This project is archived and is in readonly mode.
:constraints option in router won't accept an object
-
PreciousBodilyFluids
I wrote a test to cover this case, but the test suite won't run with it. It's attached anyhow.
It fails with:
/home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:161:in `constraints': undefined method `reject' for TestRoutingMapper::IpRestrictor:Class (NoMethodError) from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:101:in `conditions' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:44:in `to_route' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:211:in `match' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:369:in `match' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:735:in `match' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:287:in `map_method' from /home/chris/rails/actionpack/lib/action_dispatch/routing/mapper.rb:239:in `get' from ./test/dispatch/routing_test.rb:71 from /home/chris/rails/actionpack/lib/action_dispatch/routing/route_set.rb:215:in `instance_exec' from /home/chris/rails/actionpack/lib/action_dispatch/routing/route_set.rb:215:in `draw' from ./test/dispatch/routing_test.rb:17 from ./test/abstract_unit.rb:188:in `stub_controllers' from ./test/dispatch/routing_test.rb:15 from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:208:in `load' from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:208:in `load' from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:198:in `load_dependency' from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:554:in `new_constants_in' from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:198:in `load_dependency' from /home/chris/rails/activesupport/lib/active_support/dependencies.rb:208:in `load' from /home/chris/.rvm/gems/ree-1.8.7-2010.02@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from /home/chris/.rvm/gems/ree-1.8.7-2010.02@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' from /home/chris/.rvm/gems/ree-1.8.7-2010.02@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 rake aborted! Command failed with status (1): [/home/chris/.rvm/rubies/ree-1.8.7-2010.02/...] -
Andrew White
- Tag set to rails 3.0, actiondispatch, constraints, patch, routing
Attached patch fixes the problem - thanks for the test case.
-
Andrew White
- Assigned user set to Jeremy Kemper
-
Repository
- State changed from new to resolved
(from [65ce3d12971afd15de6ea22a2fc5af3ba1faf124]) Accept an object for :constraints option [#4904 :constraints option in router won't accept an object state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/65ce3d12971afd15de6ea22a2fc5af...
