From: ENT8R Date: Tue, 9 Oct 2018 12:50:55 +0000 (+0200) Subject: Fix Rubocop issue X-Git-Tag: live~2846^2~2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/08597488159ca534ee6a3469712515e4760a0f99?hp=3cdf4f3686aca9054e85d61ac62acaa98b16c42b Fix Rubocop issue --- diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 27c3f4f83..18b862014 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -275,11 +275,11 @@ class NotesController < ApplicationController # Filter by a given string if params[:q] @notes = @notes.joins(:comments) - if @user - @notes = @notes.where("to_tsvector('english', comments_notes.body) @@ plainto_tsquery('english', ?)", params[:q]) - else - @notes = @notes.where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q]) - end + @notes = if @user + @notes.where("to_tsvector('english', comments_notes.body) @@ plainto_tsquery('english', ?)", params[:q]) + else + @notes.where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q]) + end end # Filter by a given start date and an optional end date