Commit a0fd5611 authored by Kati Paizee's avatar Kati Paizee

Merge branch 'docs-aa-enforce-limit-to-plucked-id' into 'master'

Enforce limit to plucked IDs docs update

See merge request gitlab-org/gitlab!74422
parents 861c3dde adaa288c
...@@ -249,6 +249,9 @@ In line with our `CodeReuse/ActiveRecord` cop, you should only use forms like ...@@ -249,6 +249,9 @@ In line with our `CodeReuse/ActiveRecord` cop, you should only use forms like
use the `ApplicationRecord`-provided `.pluck_primary_key` helper method instead. use the `ApplicationRecord`-provided `.pluck_primary_key` helper method instead.
In the latter, you should add a small helper method to the relevant model. In the latter, you should add a small helper method to the relevant model.
If you have strong reasons to use `pluck`, it could make sense to limit the number
of records plucked. `MAX_PLUCK` defaults to `1_000` in `ApplicationRecord`.
## Inherit from ApplicationRecord ## Inherit from ApplicationRecord
Most models in the GitLab codebase should inherit from `ApplicationRecord`, Most models in the GitLab codebase should inherit from `ApplicationRecord`,
......
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