From 1ad601cd9da43a5944a733311292335596fa365d Mon Sep 17 00:00:00 2001 From: Manuel Wegria Date: Wed, 12 Jun 2024 10:05:23 +0200 Subject: [PATCH] add append_where_date_is_set --- app/models/search/complex_datation_strategy.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/search/complex_datation_strategy.rb b/app/models/search/complex_datation_strategy.rb index 686489a56..8112c1ec4 100644 --- a/app/models/search/complex_datation_strategy.rb +++ b/app/models/search/complex_datation_strategy.rb @@ -35,6 +35,7 @@ def search(scope, criteria) if negate date_scope = scope.where("#{sql_select_table_name}.data->'#{field.uuid}'->>'selected_format' = 'date_time'") + date_scope = append_where_data_is_set(date_scope) scope = id_scope.or(date_scope) else scope = id_scope.or(search_dates(original_scope, start_date_time, end_date_time, field_condition, negate, true)) @@ -51,6 +52,7 @@ def search(scope, criteria) if negate date_scope = scope.where("#{sql_select_table_name}.data->'#{field.uuid}'->>'selected_format' = 'date_time'") + date_scope = append_where_data_is_set(date_scope) else date_scope = search_dates(scope, start_date_time, end_date_time, field_condition, negate, true) end