Rails won't find CSV fixtures

假如想象 提交于 2019-12-13 19:13:13

问题


I am trying to use CSV fixtures, but when I do rake db:fixtures:load, it complains about the lack of YAML files in test/fixtures. Everything works fine when the fixtures are in YAML and the files end in .yml.

Furthermore, when I look at the code in activerecord-3.2.3/lib/active_record/fixtures.rb, I see absolutely no reference to CSV processing. It appears that fixtures.rb only knows how to use YAML fixtures.

What is up here? Have CSV fixtures been deprecated?


回答1:


CSV Fixtures are deprecated and support will be removed in Rails 3.2.0

http://guides.rubyonrails.org/3_1_release_notes.html

https://github.com/rails/rails/commit/1716da07204193c8acf967e2d75a53a82e4c7c28#activerecord/lib/active_record/fixtures.rb



来源:https://stackoverflow.com/questions/10338903/rails-wont-find-csv-fixtures

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!