Fix search feature.

This commit is contained in:
邱博亞 2024-07-15 22:36:45 +08:00
parent 99fa506a51
commit 7306409423
1 changed files with 2 additions and 2 deletions

View File

@ -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