mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
Fix RuboCop offense Rails/WhereRange (#39889).
git-svn-id: https://svn.redmine.org/redmine/trunk@22838 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a9518e28b8
commit
bd4ac7c96c
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user