Remove Approvers model
Approvers has a polymorphic belongs_to :target
relation; in this case, to MergeRequests
and Projects
. It appears to only be used to enable has_many :approval_users
on Projects
, and the two of them only seem to be referenced in specs..
Initially added in 3cc78d89, it looks it was originally used for MergeRequest#overall_approvers
which has since been moved to ./ee/app/models/concerns/visible_approvable.rb
which is only used for MergeRequest#all_approvers
, which isn't used at all.
Further, in #8647 (closed) it is mentioned that:
Existing Approver and AppoverGroup models will be deprecated.
There is a ApproverMigrateHook
concern as well which will migrate Approver
to ApprovalRule
on create/destroy of Approver
. However, Projects::ApproversController
still exists and route still exists. This controller exposes action to destroy Approver
of MergeRequest
or Project
. The Project#approver_ids=
also still exists so if something is still setting that, that will still create an Approver
record.
Given that there's nothing that we can see that is calling the background migration now, we should be able to remove the Approver
model. But we need to remove all places where it is being created/destroyed first.