Fill `organization_id` during PersonalSnippets creation process
Problem
See epic description: &13636 (closed)
Context
At the previous step Extend `snippets` table with `organization_id`... (#460825 - closed) we populated organization_id field with an ID of the default organization (id: 1).
In future, the organization will be taken from the user's scope. For that, we need to update the snippets creation process (Snippets::CreateService) to create personal snippets with a organization_id that matches snippet creator's organization.
Task
- Update
Snippets::CreateServicecode to explicitly setorganization_idfor personal snippets creation process. For project snippetsorganization_idmust be empty. - Add a Rails validation to verify that
organization_idis set for personal snippets. - Verify that there are no other ways (apart from
Snippets::CreateService) how personal snippet can be created.
MR
Edited by Hunter Stewart