Skip to content

Commit

Permalink
Fix RuboCop offense Rails/WhereRange (#39889).
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.redmine.org/redmine/trunk@22838 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
vividtone committed May 18, 2024
1 parent a9518e2 commit bd4ac7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/redmine/nested_set/issue_nested_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.included(base)
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
Expand Down
2 changes: 1 addition & 1 deletion lib/redmine/nested_set/project_nested_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.included(base)

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
Expand Down

0 comments on commit bd4ac7c

Please sign in to comment.