mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
Date search fix for repositories. [SCI-1357]
This commit is contained in:
parent
e38947b1f8
commit
092e82c722
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue