Sha256: 1c47aa99dfd26ca37d1f187e8d5fc1c792977b602558b5aa079c7b479344db0e
Contents?: true
Size: 532 Bytes
Versions: 6
Compression:
Stored size: 532 Bytes
Contents
module Renalware module Patients class PracticeSearchQuery attr_reader :search_term def initialize(search_term:) @search_term = search_term end def call return [] if search_term.blank? term = "%#{search_term}%" Practice.select(:id, :name) .joins(:address) .where("patient_practices.name ILIKE ? OR addresses.postcode ILIKE ?", term, term) # .select("patient_practices.id", "patient_practices.name") end end end end
Version data entries
6 entries across 6 versions & 1 rubygems