提交 bb47927d 编写于 作者: T thedarkone

Convert unless/else into if/else.

上级 b127e0ca
......@@ -168,10 +168,7 @@ def routing_type(options)
end
def build_named_route_call(records, inflection, options = {})
unless records.is_a?(Array)
record = extract_record(records)
route = []
else
if records.is_a?(Array)
record = records.pop
route = records.map do |parent|
if parent.is_a?(Symbol) || parent.is_a?(String)
......@@ -180,6 +177,9 @@ def build_named_route_call(records, inflection, options = {})
ActiveModel::Naming.route_key(parent).singularize
end
end
else
record = extract_record(records)
route = []
end
if record.is_a?(Symbol) || record.is_a?(String)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册