summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-03-25 01:32:23 +0000
committerGo MAEDA <maeda@farend.jp>2023-03-25 01:32:23 +0000
commit32d2b1c42f76c07e13bcf748b2071a29cf350606 (patch)
treea178f5208bdb7f5e9a43dca6cdbc5ac144b59459 /app/models/query.rb
parentf27de353381a45427b6e38b87c973902de92484f (diff)
downloadredmine-32d2b1c42f76c07e13bcf748b2071a29cf350606.tar.gz
redmine-32d2b1c42f76c07e13bcf748b2071a29cf350606.zip
Fix RuboCop offense Style/InverseMethods: Use `present?` instead of inverting `blank?` (#37248).
git-svn-id: https://svn.redmine.org/redmine/trunk@22152 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 4a0aeb4fd..473ea4d86 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -505,7 +505,7 @@ class Query < ActiveRecord::Base
add_filter_error(field, :blank) unless
# filter requires one or more values
- (values_for(field) and !values_for(field).first.blank?) or
+ (values_for(field) and values_for(field).first.present?) or
# filter doesn't require any value
["o", "c", "!*", "*", "nd", "t", "ld", "nw", "w", "lw", "l2w", "nm", "m", "lm", "y", "*o", "!o"].include? operator_for(field)
end if filters
@@ -830,7 +830,7 @@ class Query < ActiveRecord::Base
def column_names=(names)
if names
- names = names.select {|n| n.is_a?(Symbol) || !n.blank?}
+ names = names.select {|n| n.is_a?(Symbol) || n.present?}
names = names.collect {|n| n.is_a?(Symbol) ? n : n.to_sym}
if names.delete(:all_inline)
names = available_inline_columns.map(&:name) | names