Make yourself a POWr Admin on Localhost
First, find out what your user ID for your @powr.io account is:
- SELECT id FROM users WHERE email='[email protected]';
Then, find out what the ID of the admin role is in your local database:
- SELECT id FROM roles WHERE name='admin';
Note: If you don't already have an admin role in the table, insert the record, like this:
- INSERT INTO roles (name) VALUES ('admin');
Then, update your role:
- UPDATE roles_users SET role_id=id_from_roles_admin WHERE user_id=your_id;
Replace your_id with your ID from the users table and id_from_roles_admin with the ID from your roles query.
Or, in rails console
if no user u = User.new(email:"[email protected]", password: "t0themax")
admin = Role.find_or_create_by(name: "admin")
u = User.find_by_email(<email>)
u.roles << admin
u.save