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: class OptimizedFileSystemResolver < FileSystemResolver #:nodoc:
def build_query(path, details) def build_query(path, details)
exts = EXTENSIONS.map { |ext| details[ext] } exts = EXTENSIONS.map { |ext| details[ext] }
query = File.join(@path, path)
exts.each do |ext| File.join(@path, path) + exts.map { |ext|
query << "{" "{#{ext.compact.uniq.map { |e| ".#{e}," }.join}}"
ext.compact.uniq.each { |e| query << ".#{e}," } }.join
query << "}"
end
query
end end
end end