diff --git a/app/services/management/school_report_service.rb b/app/services/management/school_report_service.rb index f47230ac..9b794b7b 100644 --- a/app/services/management/school_report_service.rb +++ b/app/services/management/school_report_service.rb @@ -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