mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #8030 from calebthompson/fix-ternary
Fix gratuitous use of ternary operator
This commit is contained in:
commit
ca3b429815
1 changed files with 5 additions and 2 deletions
|
@ -29,8 +29,11 @@ module ActionView
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue