i have working rails application user authentication. want automatically have account coded because have admin role , no 1 else will. there way this?
by way, db/migrate table looks this:
class createusers < activerecord::migration def change create_table :users |t| t.string :first_name t.string :last_name t.string :email t.string :password_digest t.string :role, default => 'reader' t.timestamps null: false end end end
add migration (e.g. using rails generate migration addadmin
) creates specific user (user.create(...)
).
Comments
Post a Comment