From 39593b63428198222774b0064bdc9fac9df98a24 Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Thu, 9 Jan 2020 11:09:24 +0100 Subject: [PATCH] Fix for numeric item in SQL array --- app/models/concerns/searchable_model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/searchable_model.rb b/app/models/concerns/searchable_model.rb index 75a4dd73e..e8b4b7849 100644 --- a/app/models/concerns/searchable_model.rb +++ b/app/models/concerns/searchable_model.rb @@ -64,7 +64,7 @@ module SearchableModel a_query = query.split.map { |a| "%#{sanitize_sql_like(a)}%" } where_str = (attrs.map.with_index do |a, i| - if a == 'repository_rows.id' + if %w(repository_rows.id repository_number_values.data).include?(a) "CAST(#{a} AS TEXT) #{like} ANY (array[:t#{i}]) OR " else "(trim_html_tags(#{a})) #{like} ANY (array[:t#{i}]) OR "