From 0613118a276f5eb7f65fcf48f0fadf6ffac2f266 Mon Sep 17 00:00:00 2001 From: Bohung Date: Sun, 10 Oct 2021 18:42:15 +0800 Subject: [PATCH] Fix bug. --- app/controllers/announcements_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index ddc3745..27c8bd8 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -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|