Skip to content

Creating admin users

Glen Horton edited this page Jan 31, 2019 · 1 revision

email_address = "user@example.com"

admin = Role.find_or_create_by(name: 'admin')

admin.users << User.find_by_user_key(email_address)

admin.save