提交 ca3b4298 编写于 作者: R Rafael Mendonça França

Merge pull request #8030 from calebthompson/fix-ternary

Fix gratuitous use of ternary operator
...@@ -29,8 +29,11 @@ def determine_template(options) #:nodoc: ...@@ -29,8 +29,11 @@ def determine_template(options) #:nodoc:
handler = Template.handler_for_extension(options[:type] || "erb") handler = Template.handler_for_extension(options[:type] || "erb")
Template.new(options[:inline], "inline template", handler, :locals => keys) Template.new(options[:inline], "inline template", handler, :locals => keys)
elsif options.key?(:template) elsif options.key?(:template)
options[:template].respond_to?(:render) ? if options[:template].respond_to?(:render)
options[:template] : find_template(options[:template], options[:prefixes], false, keys, @details) options[:template]
else
find_template(options[:template], options[:prefixes], false, keys, @details)
end
else else
raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file or :text option." raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file or :text option."
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册