4

我有rails 3.1,我正在尝试用seeds.rb填充数据我有一个模型Country被迁移到国家表中

但似乎rails无法从seeds.rb中看到Country模型我收到了这个错误:

rake aborted!
uninitialized constant Object::Country

Tasks: TOP => db:seed

我的seeds.rb 文件如下所示:

# encoding: UTF-8

Country.delete_all

我的国家模型:

class Country < ActiveRecord::Base
  has_many :students
  has_many :instructors

end

有什么想法吗?

编辑

我在开发环境中,与config.threadsafe!

4

0 回答 0