Module: Quorum::JobReportSearcher
- Included in:
- BlastnJobReport, BlastpJobReport, BlastxJobReport, TblastnJobReport
- Defined in:
- app/models/quorum/job_report_searcher.rb
Instance Method Summary collapse
-
#search(algo, params) ⇒ Object
Simple search interface on query, id and job id for job reports.
Instance Method Details
#search(algo, params) ⇒ Object
Simple search interface on query, id and job id for job reports.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/quorum/job_report_searcher.rb', line 7 def search(algo, params) algo.downcase! klass = "quorum/#{algo}_job_report".camelize.constantize if params[:"#{algo}_id"].present? && params[:query].present? klass.where( "quorum_#{algo}_job_reports.id IN (?) AND query = ? " << "AND #{algo}_job_id = ?", params[:"#{algo}_id"].split(","), params[:query], params[:id] ) elsif params[:"#{algo}_id"].present? klass.where( "quorum_#{algo}_job_reports.id IN (?) AND #{algo}_job_id = ? ", params[:"#{algo}_id"].split(","), params[:id] ) elsif params[:query].present? klass.where( "query = ? AND #{algo}_job_id = ?", params[:query], params[:id] ) else klass.where("#{algo}_job_id = ?", params[:id]) end end |