mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #32799 from printercu/patch-6
Use usual method definition instead of extracting args from array
This commit is contained in:
commit
4a786c0fdf
1 changed files with 4 additions and 11 deletions
|
@ -70,18 +70,11 @@ module ActionView
|
|||
end
|
||||
|
||||
private
|
||||
def find_template(finder, *args)
|
||||
name = args.first
|
||||
prefixes = args[1] || []
|
||||
partial = args[2] || false
|
||||
keys = args[3] || []
|
||||
options = args[4] || {}
|
||||
def find_template(finder, name, prefixes, partial, keys)
|
||||
finder.disable_cache do
|
||||
if format = finder.rendered_format
|
||||
finder.find_all(name, prefixes, partial, keys, options.merge(formats: [format])).first || finder.find_all(name, prefixes, partial, keys, options).first
|
||||
else
|
||||
finder.find_all(name, prefixes, partial, keys, options).first
|
||||
end
|
||||
format = finder.rendered_format
|
||||
result = finder.find_all(name, prefixes, partial, keys, formats: [format]).first if format
|
||||
result || finder.find_all(name, prefixes, partial, keys).first
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue