From f2a1871f247e6c4efc50cde9778060d757f13a30 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 16 Sep 2023 10:39:57 +1000 Subject: [PATCH] sort media --- slices/admin/views/photos/index.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slices/admin/views/photos/index.rb b/slices/admin/views/photos/index.rb index bcd5eab..07b29e5 100644 --- a/slices/admin/views/photos/index.rb +++ b/slices/admin/views/photos/index.rb @@ -7,7 +7,7 @@ module Admin expose :photos_buckets do |available_paths| available_paths.each_with_object({}) do |root, memo| - memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"] + memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"].sort {|a,b| File.ctime(a) <=> File.ctime(b) } end end