fix not support &. operation in low ruby version

openi_sso
p31729568 6 years ago
parent 44dadbc173
commit f1b1ea0cd3

@ -14,7 +14,7 @@ class Management::SchoolReportService
def call
schools = School.select(select_columns_sql)
keyword = params[:keyword]&.to_s&.strip
keyword = params[:keyword].try(:to_s).try(:strip)
if keyword.present?
schools = schools.where("schools.name LIKE :keyword OR schools.id LIKE :keyword", keyword: "%#{keyword}%")
end

Loading…
Cancel
Save