Add GlobalID to BranchRule models
We need IDs for BranchRules to be able to edit and delete them via the API. To do this we should add GlobalID https://github.com/rails/globalid to the Branch Rule models and add a find(id)
method.
Mix GlobalID::Identification into any model with a #find(id) class method. Support is automatically included in Active Record.
We can include the global ID Identification module into our models to accomplish this nicely.
Normal BranchRules will expose the ProtectedBranch ID with BranchRule as the model name e.g. gid://gitlab/Projects::BranchRule/12
where 12 is the protected branch ID.
For AllBranchesRule and AllProtectedBranchesRule the id will be the project id e.g. gid://gitlab/Projects::AllBranchesRule/29
where 29 is the project ID