We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43ec4ce commit e2781c2Copy full SHA for e2781c2
actionview/lib/action_view/template/resolver.rb
@@ -324,12 +324,12 @@ def template_glob(glob)
324
query = File.join(escape_entry(@path), glob)
325
path_with_slash = File.join(@path, "")
326
327
- Dir.glob(query).reject do |filename|
328
- File.directory?(filename)
329
- end.map do |filename|
330
- File.expand_path(filename)
331
- end.select do |filename|
332
- filename.start_with?(path_with_slash)
+ Dir.glob(query).filter_map do |filename|
+ filename = File.expand_path(filename)
+ next if File.directory?(filename)
+ next unless filename.start_with?(path_with_slash)
+
+ filename
333
end
334
335
0 commit comments