From 7306409423a21ae57b6e768e7ae46f1470b39e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 15 Jul 2024 22:36:45 +0800 Subject: [PATCH] Fix search feature. --- app/controllers/universal_tables_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/universal_tables_controller.rb b/app/controllers/universal_tables_controller.rb index ddc1159..6daa4eb 100644 --- a/app/controllers/universal_tables_controller.rb +++ b/app/controllers/universal_tables_controller.rb @@ -202,9 +202,9 @@ class UniversalTablesController < ApplicationController regex = Regexp.union(regexes.map{|word| Regexp.new(".*"+word+".*", "i")}) end if column.type == "text" - columns = column.column_entries.any_of(:"text.en" => regex, :"text.zh_tw" => regex) + columns = column.column_entries.any_of([{"text.en" => regex}, {"text.zh_tw" => regex}]) elsif column.type == "editor" - columns = column.column_entries.any_of(:"content.en" => regex, :"content.zh_tw" => regex) + columns = column.column_entries.any_of([{"content.en" => regex}, {"content.zh_tw" => regex}]) end # .or(:"content.en" => regex).or(:"content.zh_tw" => regex) if paginated