Skip to content

Instantly share code, notes, and snippets.

@lpsm-dev
Created October 6, 2022 20:02
Show Gist options
  • Save lpsm-dev/b209e3bd8f2e6f08742ed23663f7f367 to your computer and use it in GitHub Desktop.
Save lpsm-dev/b209e3bd8f2e6f08742ed23663f7f367 to your computer and use it in GitHub Desktop.
[GitLab] - Create Admin user in Rails Console
user = User.new(username: 'user', email: 'user@user.com.br', name: 'user', password: 'user', password_confirmation: 'user')
# Use it only if you wish user to be automatically confirmed. If skipped, user receives confirmation e-mail
user.skip_confirmation!
user.admin = true
user.save!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment