Commit be4d3c57 authored by Andrew Fontaine's avatar Andrew Fontaine Committed by Marcia Ramos

Add Some Extra Documentation Around Mass Insert

Including how to add a user as a maintainer to any number of the newly
inserted projects.
parent ecae19a6
......@@ -69,6 +69,7 @@ description: 'Learn how to contribute to GitLab.'
- [Developing against interacting components or features](interacting_components.md)
- [File uploads](uploads.md)
- [Auto DevOps development guide](auto_devops.md)
- [Mass Inserting Models](mass_insert.md)
- [Cycle Analytics development guide](cycle_analytics.md)
## Performance guides
......
# Mass Inserting Rails Models
Setting the environment variable [`MASS_INSERT=1`](rake_tasks.md#env-variables)
when running `rake setup` will create millions of records, but these records
aren't visible to the `root` user by default.
To make any number of the mass-inserted projects visible to the `root` user, run
the following snippet in the rails console.
```ruby
u = User.find(1)
Project.last(100).each { |p| p.set_create_timestamps && p.add_maintainer(u, current_user: u) } # Change 100 to whatever number of projects you need access to
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment