Investigate: Handle setting sharding key
- Our current factory for
ee/app/models/merge_requests/approval_rule.rb
class fails validation so probably we need to address that first (needs a sharding id) - I see we have a validation to to make sure
validate :ensure_single_sharding_key
. We don’t currently have any logic to handle setting the id on creation like how the existing ApprovalRulesMergeRequest does via:
before_create :set_project_id
private
def set_project_id
self.project_id = merge_request.source_project.id
end
Edited by Hunter Stewart