Skip to content

Rake command option

baban edited this page Jun 20, 2018 · 7 revisions

flextures gem can load and dump data, CSV and YAML format Command is generated by rake

rake db:flextures:load
rake db:flextures:dump

rake commands can have options below commands table data

rake db:flextures:load TABLE=users # set tablea name
rake db:flextures:dump MODEL=User  # set ActiveRecord model name

if you want to dump many table datas, TABLE option can set canna(",") separated value

rake db:flextures:dump T=users,items # T is TABLE options alias

FILE option can set filename

rake db:flextures:dump T=users FILE=users2 # dump users2.csv

if you want to change format CSV to YAML, use FORMAT option

rake db:flextures:dump T=users FORMAT=yml # dump users.yml

other options ...

option description
TABLE set table name
MODEL set model name
DIR set directory name
FORMAT set file format (csv or yml)
FIXTUES set file name
FILE set file name(same FIXTURES option)
OPTION other options
PLUS add column name
MINUS load or dump columns delete
T alias of TABlE option
M alias of MODEL option
D alias of DIR option
F alias of FILE option

OPTION values

option description
stair 階差ロード機能を使用します
sillent error message delete
unfilter forbiddon FactoryFilter