Fix search by ID for project cards [SCI-7564]

This commit is contained in:
Oleksii Kriuchykhin 2022-12-08 21:24:21 +01:00
parent 08b9ec24f0
commit c35df9a762

View file

@ -110,7 +110,9 @@ class ProjectsOverviewService
def filter_project_records(records)
records = records.archived if @view_mode == 'archived'
records = records.active if @view_mode == 'active'
records = records.where_attributes_like('projects.name', @params[:search]) if @params[:search].present?
if @params[:search].present?
records = records.where_attributes_like(['projects.name', Project::PREFIXED_ID_SQL], @params[:search])
end
if @params[:members].present?
records = records.joins(:user_assignments).where(user_assignments: { user_id: @params[:members] })
end