Skip to content

Commit

Permalink
Thanks tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Jan 11, 2024
1 parent 7abad71 commit 99635a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def show
cond_text = filter_names.map{|w| "LOWER(entries.body) like ?"}.join(" OR ")
cond_values = filter_names.map{|w| "%#{w}%"}
@entries = current_user.entries.where(cond_text, *cond_values)
elsif search_params[:term].include?('"')
elsif search_params[:term].present? && search_params[:term].include?('"')
exact_phrase = search_params[:term].delete('"')
@entries = current_user.entries.where("entries.body ~* ?", "\\m#{exact_phrase}\\M")
else
Expand Down

0 comments on commit 99635a9

Please sign in to comment.