diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-24 14:24:24 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-27 13:29:40 +0300 |
commit | da42dfb3cf4a2fb0cdcc1a3b41438516a0bed0e5 (patch) | |
tree | 1dc5014e27ce049e47e8670b83b79e0c49bb96b9 /app/models/milestone.rb | |
parent | d4eea275310867eccc927d0e92a1d19a165f0668 (diff) |
Use fuzzy search with minimum length of 3 characters where appropriate
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index e25d72cf947..c06ee8083f0 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -74,10 +74,7 @@ class Milestone < ActiveRecord::Base # # Returns an ActiveRecord::Relation. def search(query) - t = arel_table - pattern = to_pattern(query) - - where(t[:title].matches(pattern).or(t[:description].matches(pattern))) + fuzzy_search(query, [:title, :description]) end def filter_by_state(milestones, state) |