Right now when I change User.first.admin = false, to User.first.admin = true it does not save. Even if I run User.first.save afterwards. While if I make
variable = User.first
variable.admin = true
variable.admin
it will return true(default is false)
But the user in my actual application is still not given the extra features they would be if admin = true, so how do I properly set admin to true for my first User in the rails console(with pry) ? Thanks for the help.
User.first.update :admin => true
Alternatively, after variable.admin = true, you can just run
variable.save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With