Changing my 'seed' file - Rails

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!

Answers


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

Need Your Help

How to integrate Crystal Reports in WPF?

wpf vb.net crystal-reports

I'm working on a WPF (VB) project where I need to link the existing crystal report to the WPF application. The user will enter a job number from my WPF application; after that I need to run the query

Calculation in CASE WHEN statement

sql postgresql

I have this extract form a query im writing.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.