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