提交 061f7fce 编写于 作者: K Kasper Timm Hansen

Merge pull request #22355 from yui-knk/remove_arity_check

Remove arity check for `RouteSet#draw`
...@@ -371,10 +371,6 @@ def prepend(&block) ...@@ -371,10 +371,6 @@ def prepend(&block)
end end
def eval_block(block) def eval_block(block)
if block.arity == 1
raise "You are using the old router DSL which has been removed in Rails 3.1. " <<
"Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/"
end
mapper = Mapper.new(self) mapper = Mapper.new(self)
if default_scope if default_scope
mapper.with_default_scope(default_scope, &block) mapper.with_default_scope(default_scope, &block)
......
...@@ -289,12 +289,6 @@ def test_non_greedy_glob_regexp ...@@ -289,12 +289,6 @@ def test_non_greedy_glob_regexp
assert_equal({:id=>"1", :filters=>"foo", :format=>"js"}, params) assert_equal({:id=>"1", :filters=>"foo", :format=>"js"}, params)
end end
def test_draw_with_block_arity_one_raises
assert_raise(RuntimeError) do
rs.draw { |map| map.match '/:controller(/:action(/:id))' }
end
end
def test_specific_controller_action_failure def test_specific_controller_action_failure
rs.draw do rs.draw do
mount lambda {} => "/foo" mount lambda {} => "/foo"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册