Rails 找不到 CSV 固定装置 [英] Rails won't find CSV fixtures

查看:35
本文介绍了Rails 找不到 CSV 固定装置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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

https://github.com/rails/rails/commit/1716da07204193c8acf967e2d75a53a82e4c7c28#a​​ctiverecord/lib/active_record/fixtures.rb

这篇关于Rails 找不到 CSV 固定装置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆