diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /lib/gitlab/relative_positioning/item_context.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'lib/gitlab/relative_positioning/item_context.rb')
-rw-r--r-- | lib/gitlab/relative_positioning/item_context.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/gitlab/relative_positioning/item_context.rb b/lib/gitlab/relative_positioning/item_context.rb index ac0598d8d34..a9966c0f3fb 100644 --- a/lib/gitlab/relative_positioning/item_context.rb +++ b/lib/gitlab/relative_positioning/item_context.rb @@ -91,8 +91,7 @@ module Gitlab relation = yield relation if block_given? relation - .pluck(grouping_column, Arel.sql("#{calculation}(relative_position) AS position")) - .first&.last + .pick(grouping_column, Arel.sql("#{calculation}(relative_position) AS position"))&.last end def grouping_column @@ -163,9 +162,7 @@ module Gitlab gap = model_class .from(items_with_next_pos, :items) .where('next_pos IS NULL OR ABS(pos::bigint - next_pos::bigint) >= ?', MIN_GAP) - .limit(1) - .pluck(:pos, :next_pos) - .first + .pick(:pos, :next_pos) return if gap.nil? || gap.first == default_end |