diff --git a/app/controllers/universal_tables_controller.rb b/app/controllers/universal_tables_controller.rb index 9af6641..292d332 100644 --- a/app/controllers/universal_tables_controller.rb +++ b/app/controllers/universal_tables_controller.rb @@ -181,10 +181,13 @@ class UniversalTablesController < ApplicationController if params["column"].present? keywords = params["q"] keywords = keywords.strip.nil? ? keywords : keywords.strip - regexes = keywords.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/) - regex = Regexp.union(regexes.map{|word| Regexp.new(".*"+word+".*", "i")}) - column = table.table_columns.where(:key => params["column"]).first + if column.make_categorizable + regex = Regexp.new(".*"+keywords+".*", "i") + else + regexes = keywords.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/) + regex = Regexp.union(regexes.map{|word| Regexp.new(".*"+word+".*", "i")}) + end if params["sort"].present? column_to_sort = table.table_columns.where(:key => params["sortcolumn"]).first case column_to_sort.type