From 092e82c7224aa32ce2e786eb2ef6e4c856c5e08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Wed, 14 Jun 2017 19:33:06 +0200 Subject: [PATCH] Date search fix for repositories. [SCI-1357] --- app/datatables/repository_datatable.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/datatables/repository_datatable.rb b/app/datatables/repository_datatable.rb index 7ca2f07c0..bf1f2f947 100644 --- a/app/datatables/repository_datatable.rb +++ b/app/datatables/repository_datatable.rb @@ -184,14 +184,15 @@ class RepositoryDatatable < AjaxDatatablesRails::Base records end - # Overriden to make it work for custom columns, because they are polymorphic + # Overriden to make it work for custom columns, because they are polymorphic def simple_search(records) return records unless params[:search].present? && params[:search][:value].present? search_val = params[:search][:value] filtered_ids = RepositoryRow.select do |r| - row_cells = [r.name, r.created_at.to_s, r.created_by.full_name] + row_cells = [r.name, r.created_at.strftime(Constants::DATE_FORMAT), + r.created_by.full_name] row_cells.push(*r.repository_cells.collect { |c| c.value.data }) row_cells.any? { |c| c.include?(search_val) } end