1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

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
This commit is contained in:
Toshi MARUYAMA 2019-10-22 15:54:24 +00:00
parent 790d2bae70
commit 48b2c8bc36
2 changed files with 1 additions and 2 deletions

View File

@ -1143,7 +1143,6 @@ Style/ParallelAssignment:
# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. # Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
Style/ParenthesesAroundCondition: Style/ParenthesesAroundCondition:
Exclude: Exclude:
- 'app/models/query.rb'
- 'app/models/repository/subversion.rb' - 'app/models/repository/subversion.rb'
- 'app/models/time_entry.rb' - 'app/models/time_entry.rb'
- 'app/models/wiki_page.rb' - 'app/models/wiki_page.rb'

View File

@ -1171,7 +1171,7 @@ class Query < ActiveRecord::Base
end end
when "!*" when "!*"
sql = "#{db_table}.#{db_field} IS NULL" 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 "*" when "*"
sql = "#{db_table}.#{db_field} IS NOT NULL" sql = "#{db_table}.#{db_field} IS NOT NULL"
sql += " AND #{db_table}.#{db_field} <> ''" if is_custom_filter sql += " AND #{db_table}.#{db_field} <> ''" if is_custom_filter