diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-24 11:45:19 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-24 17:28:50 +0100 |
commit | aedd2cfa5b82c01f82ec26b64880fce2a07fe942 (patch) | |
tree | e8c2094d81b86a471fdbb9de4f4a279ec0a0ef75 /app/models/milestone.rb | |
parent | b355ebc4c9b38320366d7640ecf51da23fbb7ea1 (diff) | |
download | gitlab-ce-aedd2cfa5b82c01f82ec26b64880fce2a07fe942.tar.gz |
Use Gitlab::SQL::Pattern where appropriate
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 01458120cda..e25d72cf947 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -13,6 +13,7 @@ class Milestone < ActiveRecord::Base include Referable include StripAttribute include Milestoneish + include Gitlab::SQL::Pattern cache_markdown_field :title, pipeline: :single_line cache_markdown_field :description @@ -74,7 +75,7 @@ class Milestone < ActiveRecord::Base # Returns an ActiveRecord::Relation. def search(query) t = arel_table - pattern = "%#{query}%" + pattern = to_pattern(query) where(t[:title].matches(pattern).or(t[:description].matches(pattern))) end |