Utilization of seed file

What is a seed file?

What defines the data that you want to put in the database in advance By defining the data in advance, you can easily put the data in the database with a command.

Defined in seed file

db/seeds.rb


Category.create(name:'mens')
Category.create(name:'Women')
Category.create(name:'Kids')

Command execution

% rails db:seed

Success if the database contains data

Recommended Posts

Utilization of seed file
Utilization of Active Hash
Utilization of Rails Boolean type
Rotate by file size of logback
Replace the contents of the Jar file
Easy implementation of Android file browsing
Utilization of swift video progress bar / UIGestureRecognizerDelegate
Utilization of Talend component (5) Create your own component