From 4475902403acb9a909aa39c4747ea7beffdaa444 Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 30 Apr 2013 19:14:12 -0400 Subject: [PATCH] fixes #1492 --- app/models/pool.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/pool.rb b/app/models/pool.rb index 7365d272a..d03b235d0 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -25,9 +25,9 @@ class Pool < ActiveRecord::Base params = {} if params.blank? if params[:name_matches].present? - params[:name_matches] = params[:name_matches].tr(" ", "_") - params[:name_matches] = "*#{params[:name_matches]}*" unless params[:name_matches] =~ /\*/ - q = q.where("name ilike ? escape E'\\\\'", params[:name_matches].to_escaped_for_sql_like) + name_matches = params[:name_matches].tr(" ", "_") + name_matches = "*#{name_matches}*" unless name_matches =~ /\*/ + q = q.where("name ilike ? escape E'\\\\'", name_matches.to_escaped_for_sql_like) end if params[:description_matches].present?