postgresql - Rails database changing boolean into true -
hi using devise database name user.
now got parameter in database admin , type boolean.
so concern how can make true , when made user not true, default false right , want turn on admin parameters true.
i know need use console how can it? before forget using postgresql bit new here dont know how edit before using php, , using phpmyadmin so, rails console bit weird me.
any appreciated using postgresql database
assuming have model user
attribute admin
, want set user id
1 admin true, in rails console can this:
user.find(1).update(admin: true)
find
return instance corresponding id
provided.
you can learn more active record in this rails guide.
if going need more once, might consider using rails database seeding described here.
Comments
Post a Comment