提交 a729f405 编写于 作者: A Aaron Patterson

change to case / when on types

上级 b27a3aff
......@@ -247,16 +247,15 @@ def default_controller_and_action
@scope[:module]
)
if controller.is_a? Regexp
case controller
when Regexp
hash[:controller] = controller
when String, Symbol
hash[:controller] = check_controller!(controller).to_s
else
if controller
hash[:controller] = check_controller!(controller).to_s
else
unless segment_keys.include?(:controller)
message = "Missing :controller key on routes definition, please check your routes."
raise ArgumentError, message
end
unless segment_keys.include?(:controller)
message = "Missing :controller key on routes definition, please check your routes."
raise ArgumentError, message
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册