Skip to content

Commit

Permalink
Only remove SequelPaginator tmp field when present
Browse files Browse the repository at this point in the history
  • Loading branch information
Samze committed Oct 8, 2024
1 parent adfc489 commit 36e75f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cloud_controller/paging/sequel_paginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def paginate_with_window_function(dataset, per_page, page, table_name)
records = paged_dataset.all

count = records.any? ? records.first[:pagination_total_results] : 0

records.each do |x|
x.values.delete(:pagination_total_results)
x.values.delete(:tmp_deferred_id)
Expand All @@ -74,7 +75,9 @@ def paginate_with_extension(dataset, per_page, page, table_name)
end

records = paged_dataset.all
records.each { |x| x.values.delete(:tmp_deferred_id) }

has_tmp_deferred_id = records.first&.keys&.include?(:tmp_deferred_id)
records.each { |x| x.values.delete(:tmp_deferred_id) } if has_tmp_deferred_id

[records, count]
end
Expand Down

0 comments on commit 36e75f2

Please sign in to comment.