I created City model and I have all cities that I need to store in city table in a .sql file. This sql file has all ‘insert into’ statements needed.
So, I would like to create a seed file to add all cities from the sql file. How could I seed a database using sql commands?
Thanks!
Using the following code you’ll achieve what you want
That would need to go in your seed.rb file
Then you’d need to execute
rake db:seed