Best way to export a database table to a YAML file?

后端 未结 11 1304
野的像风
野的像风 2020-12-07 14:54

I have some data in my development database that I would like to utilize as fixtures in my test environment. What is the best way in Rails 2.x to export a database table to

11条回答
  •  余生分开走
    2020-12-07 15:49

    This plugin will add the functionality you want. It was extracted from ActiveRecord so no longer comes by default.

    script/plugin install http://github.com/topfunky/ar_fixtures

    Then run:

    rake db:fixtures:dump MODEL=ModelName

提交回复
热议问题