From 09d0bb4a322d3bc8c1b5b36a68ab93fe6378811c Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Fri, 8 Apr 2022 11:08:51 +0200 Subject: [PATCH] Fix sorting by date time columns in inventories [SCI-6683] (#4002) --- app/services/repository_datatable_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/repository_datatable_service.rb b/app/services/repository_datatable_service.rb index cfae0c089..610c351a7 100644 --- a/app/services/repository_datatable_service.rb +++ b/app/services/repository_datatable_service.rb @@ -436,7 +436,7 @@ class RepositoryDatatableService cells = sorting_data_type.joins( "INNER JOIN repository_cells AS repository_sort_cells "\ "ON repository_sort_cells.value_id = #{sorting_data_type.table_name}.id "\ - "AND repository_sort_cells.value_type = '#{sorting_data_type}'" + "AND repository_sort_cells.value_type = '#{sorting_data_type.base_class.name}'" ).where('repository_sort_cells.repository_column_id': sorting_column.id) if sorting_data_type.const_defined?('EXTRA_SORTABLE_VALUE_INCLUDE')