diff options
-rw-r--r-- | app/models/person.rb | 4 | ||||
-rw-r--r-- | public/javascripts/search.js | 4 | ||||
-rw-r--r-- | spec/models/person_spec.rb | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/models/person.rb b/app/models/person.rb index cc6748c9d..a8c9720b6 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -62,7 +62,7 @@ class Person < ActiveRecord::Base end def self.search(query, user) - return [] if query.to_s.blank? || query.to_s.length < 3 + return [] if query.to_s.blank? || query.to_s.length < 2 sql, tokens = self.search_query_string(query) @@ -84,8 +84,6 @@ class Person < ActiveRecord::Base }.call end - - def self.public_search(query, opts={}) return [] if query.to_s.blank? || query.to_s.length < 3 sql, tokens = self.search_query_string(query) diff --git a/public/javascripts/search.js b/public/javascripts/search.js index a9d8b4af2..8cffbd52d 100644 --- a/public/javascripts/search.js +++ b/public/javascripts/search.js @@ -28,11 +28,11 @@ var Search = { } }, options : function(){return { - minChars : 3, + minChars : 2, onSelect: Search.selectItemCallback, max : 5, scroll : false, - delay : 200, + delay : 100, cacheLength : 15, extraParams : {limit : 4}, formatItem : Search.formatItem, diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 6ee99e513..e47e7aa30 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -226,8 +226,8 @@ describe Person do people.empty?.should be true end - it 'should return nothing on a two character query' do - people = Person.search("in", @user) + it 'should return nothing on a one character query' do + people = Person.search("i", @user) people.empty?.should be true end |