Commit 5cd237e8 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'document-some-mass-insert-goodness' into 'master'

Add Some Extra Documentation Around Mass Insert

See merge request gitlab-org/gitlab!20803
parents ecae19a6 be4d3c57
...@@ -69,6 +69,7 @@ description: 'Learn how to contribute to GitLab.' ...@@ -69,6 +69,7 @@ description: 'Learn how to contribute to GitLab.'
- [Developing against interacting components or features](interacting_components.md) - [Developing against interacting components or features](interacting_components.md)
- [File uploads](uploads.md) - [File uploads](uploads.md)
- [Auto DevOps development guide](auto_devops.md) - [Auto DevOps development guide](auto_devops.md)
- [Mass Inserting Models](mass_insert.md)
- [Cycle Analytics development guide](cycle_analytics.md) - [Cycle Analytics development guide](cycle_analytics.md)
## Performance guides ## 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