From 08597488159ca534ee6a3469712515e4760a0f99 Mon Sep 17 00:00:00 2001 From: ENT8R Date: Tue, 9 Oct 2018 14:50:55 +0200 Subject: [PATCH] Fix Rubocop issue --- app/controllers/notes_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.43.2