From 3d3fd39caa8f938a44fffc1c39bde8f0170e8f18 Mon Sep 17 00:00:00 2001 From: Caleb Thompson Date: Thu, 25 Oct 2012 17:00:14 -0400 Subject: Fix gratuitous use of ternary operator --- actionpack/lib/action_view/renderer/template_renderer.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index 156ad4e547..2a5ea5a711 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -29,8 +29,11 @@ module ActionView 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 -- cgit v1.2.3