问题
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