1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

refactor the optimized build_query a bit

This commit is contained in:
Aaron Patterson 2011-08-08 22:16:52 -07:00
parent 128467e927
commit 37b77c6ae7

View file

@ -237,15 +237,10 @@ module ActionView
class OptimizedFileSystemResolver < FileSystemResolver #:nodoc:
def build_query(path, details)
exts = EXTENSIONS.map { |ext| details[ext] }
query = File.join(@path, path)
exts.each do |ext|
query << "{"
ext.compact.uniq.each { |e| query << ".#{e}," }
query << "}"
end
query
File.join(@path, path) + exts.map { |ext|
"{#{ext.compact.uniq.map { |e| ".#{e}," }.join}}"
}.join
end
end