From 48b2c8bc3693af18b5dd41b6161333d7e9e698f0 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 22 Oct 2019 15:54:24 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/models/query.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18833 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 1 - app/models/query.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 23a4db637..88a3e2b6a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1143,7 +1143,6 @@ Style/ParallelAssignment: # Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. Style/ParenthesesAroundCondition: Exclude: - - 'app/models/query.rb' - 'app/models/repository/subversion.rb' - 'app/models/time_entry.rb' - 'app/models/wiki_page.rb' diff --git a/app/models/query.rb b/app/models/query.rb index 19db899d8..fe0cada37 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -1171,7 +1171,7 @@ class Query < ActiveRecord::Base end when "!*" sql = "#{db_table}.#{db_field} IS NULL" - sql += " OR #{db_table}.#{db_field} = ''" if (is_custom_filter || [:text, :string].include?(type_for(field))) + sql += " OR #{db_table}.#{db_field} = ''" if is_custom_filter || [:text, :string].include?(type_for(field)) when "*" sql = "#{db_table}.#{db_field} IS NOT NULL" sql += " AND #{db_table}.#{db_field} <> ''" if is_custom_filter