Rails 找不到 CSV 固定装置 [英] Rails won't find CSV fixtures
问题描述
我正在尝试使用 CSV 夹具,但是当我执行 rake db:fixtures:load
时,它会抱怨 test/fixtures
中缺少 YAML 文件.当装置在 YAML 中并且文件以 .yml
结尾时,一切正常.
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
.
此外,当我查看 activerecord-3.2.3/lib/active_record/fixtures.rb
中的代码时,我完全没有看到对 CSV 处理的引用.看来 fixtures.rb
只知道如何使用 YAML 装置.
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.
这里有什么?CSV 固定装置是否已被弃用?
What is up here? Have CSV fixtures been deprecated?
推荐答案
CSV Fixtures 已弃用,Rails 3.2.0 中的支持将被移除
CSV Fixtures are deprecated and support will be removed in Rails 3.2.0
http://guides.rubyonrails.org/3_1_release_notes.html
这篇关于Rails 找不到 CSV 固定装置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!