Update archives_controller.rb
This commit is contained in:
parent
d977f0e2a2
commit
e7553492bf
|
@ -19,7 +19,7 @@ class ArchivesController < ApplicationController
|
|||
all_categories_with_nil = ArchiveCategory.all.in(sort_number: nil)
|
||||
all_categories_no_nil = ArchiveCategory.all.not_in(sort_number: nil).order_by(sort_number: 'desc')
|
||||
categories_sort = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
|
||||
categories.where(:_id => cat.category_id).first
|
||||
categories.select{|category| category.id.to_s == cat.category_id.to_s)[0]
|
||||
end
|
||||
cats_last = []
|
||||
categories_sort.each do |category|
|
||||
|
@ -83,7 +83,7 @@ class ArchivesController < ApplicationController
|
|||
all_categories_with_nil = ArchiveCategory.all.in(sort_number: nil)
|
||||
all_categories_no_nil = ArchiveCategory.all.not_in(sort_number: nil).order_by(sort_number: 'desc')
|
||||
categories_sort = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
|
||||
categories.where(:_id => cat.category_id).first
|
||||
categories.select{|category| category.id.to_s == cat.category_id.to_s)[0]
|
||||
end
|
||||
cats = categories_sort.collect do |category|
|
||||
url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : ""
|
||||
|
|
Loading…
Reference in New Issue