Skip to content

Commit

Permalink
Don't add % for body
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed May 23, 2020
1 parent 2461635 commit c7e3336
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/helpers/search_helper.rb
Expand Up @@ -12,7 +12,11 @@ def self.parse_search_params(params, symbol, user)
end
else
operation = 'LIKE'
input = '%' + ActiveRecord::Base.sanitize_sql_like(input) + '%'
input = if symbol == :body
ActiveRecord::Base.sanitize_sql_like(input)
else
'%' + ActiveRecord::Base.sanitize_sql_like(input) + '%'
end
end

[input, operation]
Expand Down

0 comments on commit c7e3336

Please sign in to comment.