Skip to content

Commit 3d3fd39

Browse files
committed
Fix gratuitous use of ternary operator
1 parent cde326b commit 3d3fd39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

actionpack/lib/action_view/renderer/template_renderer.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ def determine_template(options) #:nodoc:
2929
handler = Template.handler_for_extension(options[:type] || "erb")
3030
Template.new(options[:inline], "inline template", handler, :locals => keys)
3131
elsif options.key?(:template)
32-
options[:template].respond_to?(:render) ?
33-
options[:template] : find_template(options[:template], options[:prefixes], false, keys, @details)
32+
if options[:template].respond_to?(:render)
33+
options[:template]
34+
else
35+
find_template(options[:template], options[:prefixes], false, keys, @details)
36+
end
3437
else
3538
raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file or :text option."
3639
end

0 commit comments

Comments
 (0)