From e9f3efea79d71a9358351a0bcba5036bd18648a2 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 2 Nov 2010 16:48:30 -0700 Subject: [PATCH] person searchable by diaspora_handle --- app/models/person.rb | 1 + spec/models/person_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/models/person.rb b/app/models/person.rb index 0fe6474aa..f99908eac 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -56,6 +56,7 @@ class Person q = Regexp.escape(token.to_s.strip) p = Person.searchable.all('profile.first_name' => /^#{q}/i) \ | Person.searchable.all('profile.last_name' => /^#{q}/i) \ + | Person.searchable.all('diaspora_handle' => /^#{q}/i) \ | p end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 4c25b99b3..6ce2cc48d 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -193,6 +193,10 @@ describe Person do Person.search("johnson").should_not include invisible_person Person.search("").should_not include invisible_person end + + it 'should search on handles' do + Person.search(@friend_one.diaspora_handle).should include @friend_one + end end context 'people finders for webfinger' do