Skip to content

Commit

Permalink
Merge pull request #1258 from sparc-request/jtm_remove_inactive_servi…
Browse files Browse the repository at this point in the history
…ces_rs_search

Removed inactive services from related services search [#152038451]
  • Loading branch information
amcates committed Feb 28, 2018
2 parents 5e418aa + 63d3864 commit 81807c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/controllers/catalog_manager/services_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ def set_linked_quantity_total

def search
term = params[:term].strip
services = Service.where("name LIKE '%#{term}%' OR abbreviation LIKE '%#{term}%' OR cpt_code LIKE '%#{term}%'")

services = Service.where("is_available=1 AND (name LIKE '%#{term}%' OR abbreviation LIKE '%#{term}%' OR cpt_code LIKE '%#{term}%')")
reformatted_services = []
services.each do |service|
reformatted_services << {"label" => service.display_service_name, "value" => service.name, "id" => service.id}
Expand Down

0 comments on commit 81807c6

Please sign in to comment.