Skip to content

Commit

Permalink
Merge pull request rails#8030 from calebthompson/fix-ternary
Browse files Browse the repository at this point in the history
Fix gratuitous use of ternary operator
  • Loading branch information
rafaelfranca committed Oct 25, 2012
2 parents 59a53f4 + 3d3fd39 commit ca3b429
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actionpack/lib/action_view/renderer/template_renderer.rb
Expand Up @@ -29,8 +29,11 @@ def determine_template(options) #:nodoc:
handler = Template.handler_for_extension(options[:type] || "erb")
Template.new(options[:inline], "inline template", handler, :locals => keys)
elsif options.key?(:template)
options[:template].respond_to?(:render) ?
options[:template] : find_template(options[:template], options[:prefixes], false, keys, @details)
if options[:template].respond_to?(:render)
options[:template]
else
find_template(options[:template], options[:prefixes], false, keys, @details)
end
else
raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file or :text option."
end
Expand Down

0 comments on commit ca3b429

Please sign in to comment.