Commit 2b8dcb45 authored by Jaspreet Singh's avatar Jaspreet Singh Committed by Andy Soiron

Enable API kaminari count with limit

Changelog: changed
parent 4bd3d389
--- ---
name: api_kaminari_count_with_limit name: api_kaminari_count_with_limit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23931 introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23931
rollout_issue_url: rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/353077
milestone: '11.8' milestone: '11.8'
type: ops type: ops
group: group::integrations group: group::integrations
default_enabled: false default_enabled: true
...@@ -95,7 +95,7 @@ Example response: ...@@ -95,7 +95,7 @@ Example response:
"milestone": "11.8", "milestone": "11.8",
"type": "ops", "type": "ops",
"group": "group::ecosystem", "group": "group::ecosystem",
"default_enabled": false "default_enabled": true
}, },
{ {
"name": "marginalia", "name": "marginalia",
......
...@@ -27,7 +27,7 @@ module Gitlab ...@@ -27,7 +27,7 @@ module Gitlab
end end
return pagination_data unless pagination_data.is_a?(ActiveRecord::Relation) return pagination_data unless pagination_data.is_a?(ActiveRecord::Relation)
return pagination_data unless Feature.enabled?(:api_kaminari_count_with_limit, type: :ops) return pagination_data unless Feature.enabled?(:api_kaminari_count_with_limit, type: :ops, default_enabled: :yaml)
limited_total_count = pagination_data.total_count_with_limit limited_total_count = pagination_data.total_count_with_limit
if limited_total_count > Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT if limited_total_count > Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment