From eac0da9a47f0c7b8b970833d7d5b96cfee057bf7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 29 Nov 2019 15:06:43 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/development/mass_insert.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/development/mass_insert.md (limited to 'doc/development/mass_insert.md') diff --git a/doc/development/mass_insert.md b/doc/development/mass_insert.md new file mode 100644 index 00000000000..891ce0db87d --- /dev/null +++ b/doc/development/mass_insert.md @@ -0,0 +1,13 @@ +# 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 +``` -- cgit v1.2.3