Refactor MR commit code to remove CodeReuse/ActiveRecord offense
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=506311)
</details>
<!--IssueSummary end-->
The following discussion from !173382 should be addressed:
- [ ] @project_278964_bot_445da1b60fc7336b6b6776383134d10f started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173382#note_2226265816): (+1 comment)
>
> ```suggestion
> # rubocop: disable CodeReuse/ActiveRecord -- TODO: Reason why the rule must be disabled
> ```
>
> Consider removing this inline disabling and adhering to the rubocop rule.
>
> If that isn't possible, please provide the reason as a code comment in the
> same line where the rule is disabled separated by ` -- `.
> See [rubocop best practices](https://docs.gitlab.com/ee/development/rubocop_development_guide.html#disabling-rules-inline).
>
> ----
>
> [Improve this message](https://gitlab.com/gitlab-org/gitlab/-/blob/master/tooling/danger/rubocop_inline_disable_suggestion.rb)
> or [have feedback](https://gitlab.com/gitlab-org/gitlab/-/issues/428157)?
>
>
> <!-- "generated_by_0cd138" -->
issue