summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2025-04-11 10:11:44 +0000
committerGo MAEDA <maeda@farend.jp>2025-04-11 10:11:44 +0000
commit626bd9efe2b97e9af0be6a3dee3be7c3a8cb0339 (patch)
tree51afbd48bf0d38cee9c3b4442a4bbac3afb9afcb
parent54285f461c61d47b0ea8ef2cdbe631ca08e9fcda (diff)
downloadredmine-626bd9efe2b97e9af0be6a3dee3be7c3a8cb0339.tar.gz
redmine-626bd9efe2b97e9af0be6a3dee3be7c3a8cb0339.zip
Fix RuboCop Style/ComparableBetween (#41884).
git-svn-id: https://svn.redmine.org/redmine/trunk@23634 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/helpers/gantt.rb2
-rw-r--r--test/unit/query_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index bd784609b..5854a15f2 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -502,7 +502,7 @@ module Redmine
lines(:image => gc, :top => top, :zoom => zoom,
:subject_width => subject_width, :format => :image)
# today red line
- if User.current.today >= @date_from and User.current.today <= date_to
+ if User.current.today.between?(@date_from, date_to)
gc.stroke('red')
x = (User.current.today - @date_from + 1) * zoom + subject_width
gc.draw('line %g,%g %g,%g' % [
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 24f4b1404..155a74b64 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -623,7 +623,7 @@ class QueryTest < ActiveSupport::TestCase
query.add_filter('due_date', '><t+', ['15'])
issues = find_issues_with_query(query)
assert !issues.empty?
- issues.each {|issue| assert(issue.due_date >= Date.today && issue.due_date <= (Date.today + 15))}
+ issues.each {|issue| assert(issue.due_date.between?(Date.today, (Date.today + 15)))}
end
def test_operator_less_than_ago
@@ -641,7 +641,7 @@ class QueryTest < ActiveSupport::TestCase
query.add_filter('due_date', '><t-', ['3'])
issues = find_issues_with_query(query)
assert !issues.empty?
- issues.each {|issue| assert(issue.due_date >= (Date.today - 3) && issue.due_date <= Date.today)}
+ issues.each {|issue| assert(issue.due_date.between?((Date.today - 3), Date.today))}
end
def test_operator_more_than_ago