提交 4cfa10cd 编写于 作者: A Aaron Patterson

refactor `handle_model` to use private helper methods for generation

上级 95c76a7c
......@@ -247,15 +247,13 @@ def handle_model(record)
args = []
model = record.to_model
name = if model.persisted?
named_route = if model.persisted?
args << model
model.model_name.singular_route_key
get_method_for_string model.model_name.singular_route_key
else
@key_strategy.call model.model_name
get_method_for_class model
end
named_route = get_method_for_string name
[named_route, args]
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册