diff options
author | Caleb Thompson <cjaysson@gmail.com> | 2012-10-25 17:00:14 -0400 |
---|---|---|
committer | Caleb Thompson <cjaysson@gmail.com> | 2012-10-25 17:00:14 -0400 |
commit | 3d3fd39caa8f938a44fffc1c39bde8f0170e8f18 (patch) | |
tree | f76f431f71f610720062b0e0550c4480d3468db0 /actionpack/lib/action_view/renderer | |
parent | cde326bcefa7e842d5f8090d24b700399ac3d705 (diff) | |
download | rails-3d3fd39caa8f938a44fffc1c39bde8f0170e8f18.tar.gz rails-3d3fd39caa8f938a44fffc1c39bde8f0170e8f18.tar.bz2 rails-3d3fd39caa8f938a44fffc1c39bde8f0170e8f18.zip |
Fix gratuitous use of ternary operator
Diffstat (limited to 'actionpack/lib/action_view/renderer')
-rw-r--r-- | actionpack/lib/action_view/renderer/template_renderer.rb | 7 |
1 files changed, 5 insertions, 2 deletions
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 |