This is a small app just for practicing purposes.
- Clone the repo
- Change into the app directory
$ bundle install$ rake db:setup$ rake db:test:prepare
The app has two models: User and Address. You'll notice most (if not all) their fields are string fields.
We need to be able to search users and addresses with a string query that will return all matching records from the database wherever that string happens to be, e.g. if I search users for 'anelle', I want all matching records whether the string is on the user's first name, last name, nickname, email address.
Given this requirement, here are the constraints:
- No gems that implement full-text search are allowed.
- Make sure your solution returns an
ActiveRecord::Relationobject and not anArray. This way, you can chain scopes and ensure pagination viaKaminariorwill_paginateworks as expected. - Try to develop a solution through TDD.