From 254c411bd941e7141f57046118fe048a5b82a22a Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Mon, 17 Jan 2011 13:48:52 -0800 Subject: [PATCH] prevent searching with spaces --- app/models/person.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index 0a3f480e6..09e21ab67 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -38,7 +38,7 @@ class Person < ActiveRecord::Base scope :searchable, joins(:profile).where(:profiles => {:searchable => true}) def self.search(query) - return [] if query.to_s.empty? + return [] if query.to_s.blank? where_clause = <<-SQL profiles.first_name LIKE ? OR