提交 2658d973 编写于 作者: C Carlos Antonio da Silva

Refactor hash creation in routeset

上级 afcae345
......@@ -98,6 +98,7 @@ def initialize
@helpers = []
@module = Module.new do
protected
def handle_positional_args(args, options, route)
inner_options = args.extract_options!
result = options.dup
......@@ -108,7 +109,7 @@ def handle_positional_args(args, options, route)
keys -= self.url_options.keys if self.respond_to?(:url_options)
keys -= options.keys
end
result.merge!(Hash[args.zip(keys).map { |v, k| [k, v] }])
result.merge!(Hash[keys.zip(args)])
end
result.merge!(inner_options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册