From c48f03a926073a0dddea2fcbb995e0ab76f45b71 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 14 Jun 2014 14:19:03 -0400 Subject: [PATCH] Add pool search option by ids --- app/models/pool.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/pool.rb b/app/models/pool.rb index d4f5ce3bb..332f29a64 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -53,6 +53,10 @@ class Pool < ActiveRecord::Base q = q.name_matches(params[:name_matches]) end + if params[:id].present? + q = q.where("id in (?)", params[:id].split(",")) + end + if params[:description_matches].present? q = q.where("lower(description) like ? escape E'\\\\'", "%" + params[:description_matches].mb_chars.downcase.to_escaped_for_sql_like + "%") end