1---
2stage: none
3group: unassigned
4info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
5---
6
7# Mass inserting Rails models
8
9Setting the environment variable [`MASS_INSERT=1`](rake_tasks.md#environment-variables)
10when running [`rake setup`](rake_tasks.md) creates millions of records, but these records
11aren't visible to the `root` user by default.
12
13To make any number of the mass-inserted projects visible to the `root` user, run
14the following snippet in the rails console.
15
16```ruby
17u = User.find(1)
18Project.last(100).each { |p| p.set_timestamps_for_create && p.add_maintainer(u, current_user: u) } # Change 100 to whatever number of projects you need access to
19```
20