This commit is contained in:
BoHung Chiu 2021-10-10 18:42:15 +08:00
parent a8c015f3e5
commit 0613118a27
1 changed files with 2 additions and 2 deletions

View File

@ -173,12 +173,12 @@ class AnnouncementsController < ApplicationController
tags = tags.uniq
tags_translations = Tag.where(:id.in=>tags).map{|t| [t.id.to_s,t.name]}
if tags.include?("all")
tags_translations = ["all",I18n.t(:all)] + tags_translations
tags_translations = [["all",I18n.t(:all)]] + tags_translations
end
tags_translations = tags_translations.to_h
cats_translations = Category.where(:id.in=>cats).map{|c| [c.id.to_s,c.title]}
if cats.include?("all")
cats_translations = ["all",I18n.t(:all)] + cats_translations
cats_translations = [["all",I18n.t(:all)]] + cats_translations
end
cats_translations = cats_translations.to_h
cats_relations = cats_translations.map{|cat_id,t|