diff --git a/README.md b/README.md index fc4b5aedf..40447939b 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,22 @@ Initial installation instructions are [here](http://github.com/diaspora/diaspora We are continuing to build features and improve the code base. When we think it is ready for general use, we will post more final -instructions. +instructions. Issue tracking is at [bugs.joindiaspora.com](bugs.joindiaspora.com). ## Commit Guidelines You are welcome to contribute, add to and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -Please make your changes on a topic branch in your repo and submit your pull request -from there, so that commits you don't want to submit aren't included. +You can find an introduction to the source code [here](http://github.com/diaspora/diaspora/wiki/An-Introduction-to-the-Diaspora-Source). For an idea of where to start, look at our [issue tracker](bugs.joindiaspora.com). + +Make a topic branch. By making your changes in a topic branch, you ensure that new commits to your master are not included in the pull request, and it's easier for us to merge your commits. Please do not rebase our tree into yours. See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html) for when to rebase. -All commits must be tested, and all your tests should be green +Patches must be tested, and all your tests should be green before a pull request is sent. Please write your tests in Rspec. GEMS: We would like to keep external dependencies unduplicated. We're using diff --git a/app/models/person.rb b/app/models/person.rb index 62126c9a4..c2485d40d 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -34,8 +34,21 @@ class Person /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix def self.search(query) - query = Regexp.escape( query.to_s.strip ) - Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i) + qTokens = query.to_s.strip.split(" ") + fullQueryText = Regexp.escape( query.to_s.strip ) + p = [] + + qTokens.each { + |token| + + q = Regexp.escape( token.to_s.strip ) + p = Person.all('profile.first_name' => /^#{q}/i) \ + | Person.all('profile.last_name' => /^#{q}/i) \ + | p + + } + + return p end def real_name diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index da535bfe3..b8738f934 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -160,7 +160,6 @@ describe Person do end it 'should yield results on full names' do - pending "Not yet implemented." people = Person.search("Casey Grippi") people.should == [@friend_four] end