From 228423428353d007e847ebde1d8ffe0915c99d1d Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 19 Sep 2019 23:23:25 +0800 Subject: [PATCH] Update archives_controller.rb --- app/controllers/archives_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index b92df30..7c7da09 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -20,7 +20,7 @@ class ArchivesController < ApplicationController all_categories_id = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat| cat.category_id.to_s end - categories_sort = categories.select{|category| all_categories_id.include? category.id.to_s}[0] + categories_sort = categories.select{|category| all_categories_id.include? category.id.to_s} cats_last = [] categories_sort.each do |category| url_to_edit = "" @@ -85,7 +85,7 @@ class ArchivesController < ApplicationController all_categories_id = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat| cat.category_id.to_s end - categories_sort = categories.select{|category| all_categories_id.include? category.id.to_s}[0] + categories_sort = categories.select{|category| all_categories_id.include? category.id.to_s} cats = categories_sort.collect do |category| url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : "" archives = files_by_cateogry[category].collect do |archive|