diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 58ea988fd..14a5be4af 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -54,7 +54,7 @@ class CaseLog < ApplicationRecord scope :filter_by_id, ->(id) { where(id:) } scope :filter_by_tenant_code, ->(tenant_code) { where("lower(tenant_code) ILIKE ?", "%#{tenant_code.downcase}%") } scope :filter_by_propcode, ->(propcode) { where("lower(propcode) ILIKE ?", "%#{propcode.downcase}%") } - scope :filter_by_postcode, ->(postcode_full) { where("lower(postcode_full) ILIKE ?", "%#{postcode_full.upcase.gsub(/\s+/, "")}%") } + scope :filter_by_postcode, ->(postcode_full) { where("lower(postcode_full) ILIKE ?", "%#{postcode_full.upcase.gsub(/\s+/, '')}%") } scope :search_by, lambda { |param| filter_by_id(param) .or(filter_by_tenant_code(param))