1
0
Fork 0
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:
Ryuta Kamizono 2018-05-03 19:21:17 +09:00 committed by GitHub
commit 4a786c0fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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