From bd4ac7c96c590d08c865908de2cf82f3e5640f96 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 18 May 2024 06:17:51 +0000 Subject: [PATCH] Fix RuboCop offense Rails/WhereRange (#39889). git-svn-id: https://svn.redmine.org/redmine/trunk@22838 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/nested_set/issue_nested_set.rb | 2 +- lib/redmine/nested_set/project_nested_set.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine/nested_set/issue_nested_set.rb b/lib/redmine/nested_set/issue_nested_set.rb index 8655ee325..1b775c3bb 100644 --- a/lib/redmine/nested_set/issue_nested_set.rb +++ b/lib/redmine/nested_set/issue_nested_set.rb @@ -38,7 +38,7 @@ module Redmine def target_lft scope_for_max_rgt = self.class.where(:root_id => root_id).where(:parent_id => parent_id) if id - scope_for_max_rgt = scope_for_max_rgt.where("id < ?", id) + scope_for_max_rgt = scope_for_max_rgt.where(id: ...id) end max_rgt = scope_for_max_rgt.maximum(:rgt) if max_rgt diff --git a/lib/redmine/nested_set/project_nested_set.rb b/lib/redmine/nested_set/project_nested_set.rb index c3a095888..e34f9adf4 100644 --- a/lib/redmine/nested_set/project_nested_set.rb +++ b/lib/redmine/nested_set/project_nested_set.rb @@ -40,7 +40,7 @@ module Redmine def target_lft siblings_rgt = - self.class.where(:parent_id => parent_id).where("name < ?", name).maximum(:rgt) + self.class.where(:parent_id => parent_id).where(name: ...name).maximum(:rgt) if siblings_rgt siblings_rgt + 1 elsif parent_id -- 2.39.5