Development
Goals
Refine search tags selection
- display all tags
- provide search_mode selection : exactly all tags, any tag, all tags and maybe more
Changes
-
db/migrate/20191211142009_add_search_mode_to_results.rb
: addedsearch_mode
attribute toresults
table -
app/models/result.rb
: updated logic to usesearch_mode
-
app/controllers/results_controller.rb
: addedsearch_mode
to strong params -
app/views/results/_form.html.erb
: addedsearch_mode
selection to search form -
db/seeds.rb
: added Results removal
Tests
-
all composition tags are displayed in search form : PASSED -
a search_mode
selection is displayed in search form : PASSED -
strict_mode
only returns composts that match exactly the selectedcomposition_tags
: PASSED -
cool_mode
returns composts that have at least one tag in common with the selected ones : PASSED -
normal_mode
returns composts that have all the selected tags and may have more : PASSED
Links
Edited by Heroponne