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