Reputation: 3542
I have already seeded my user into the database, but now I would like to change one of those fields. It seems, like the migrations, I cannot just edit the file and run rake db:seed
. That doesnt seem to change anything. How do I edit something I have already seeded in? Thanks!
Upvotes: 1
Views: 1016
Reputation: 7339
You can use the console to change data you've already seeded, or is otherwise already in your database. If it's a lot of data you need to change you can write a migration to make changes to the data, as well as the table structure.
To use the console
rails c
> u = User.last
> u.first_name = "BoyGeorge"
> u.save
Upvotes: 2