mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 05:34:55 +08:00
Minor repository search refactoring. [SCI-1357]
This commit is contained in:
parent
be4a8d494a
commit
e38947b1f8
1 changed files with 3 additions and 6 deletions
|
@ -191,12 +191,9 @@ class RepositoryDatatable < AjaxDatatablesRails::Base
|
|||
search_val = params[:search][:value]
|
||||
|
||||
filtered_ids = RepositoryRow.select do |r|
|
||||
[r.name, r.created_at.to_s, r.created_by.full_name].any? do |s|
|
||||
s.include?(search_val)
|
||||
end ||
|
||||
r.repository_cells.map do |c|
|
||||
c.value.data.include?(search_val)
|
||||
end.any?
|
||||
row_cells = [r.name, r.created_at.to_s, 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
|
||||
records.where!(id: filtered_ids)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue