From 24b83d1c578339c5bfd1c7c593c959b1182dff21 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 13 Jul 2016 12:04:30 -0400 Subject: [PATCH] DOCS: Much better way to create an admin account. Thanks @techapj --- docs/VAGRANT.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/VAGRANT.md b/docs/VAGRANT.md index 71bd278d43f..f1393aa96ee 100644 --- a/docs/VAGRANT.md +++ b/docs/VAGRANT.md @@ -96,23 +96,11 @@ You can now edit files on your local file system, using your favorite text edito ### Creating an Admin User -You'll want an admin account to be able to do anything fun on your new Discourse environment. The easiest way to do this is to sign up for an account in the web browser with a username and password. - -Once you have done that, you'll notice **no mail is delivered** to confirm it. This is because in the development environment emails are disabled by default. - -An easy way to approve your account and give it admin access is to enter a rails console and update the data. Run the following commands after `vagrant ssh`: +You'll want an admin account to be able to do anything fun on your new Discourse environment. Enter your vagrant image by using `vagrant ssh` then +run the following command and follow the instructions: ```bash -cd /vagrant -bundle exec rails console -``` - -Once the console opens, enter the following commands. Make sure to replace `eviltrout` with the username you signed up with. - -```ruby -user = User.find_by_username('eviltrout') -user.update_columns(admin: true) -EmailToken.confirm(user.email_tokens.pluck(:token).last) +rake admin:create ``` Your admin account should be approved. Log in in your browser and you're good to go!