这个rake db:seed错误意味着什么?
我一直试图解决这个问题几个小时,但我似乎无法理解发生了什么。
我正在使用Rails 3 beta,并希望将一些数据播种到数据库中。 但是,当我尝试通过db:seed播种一些值时,我收到此错误:
耙子流产了!
属性(#81402440)预期,得到数组(#69024170)
seeds.rb是:
DataType.delete_all DataType.create( :name => 'String' )
我得到了这些课程:
class DataType < ActiveRecord::Base has_many :attributes end class Attribute < ActiveRecord::Base belongs_to :data_types end
只是为了澄清,目的是让Attribute对象具有一种数据类型(例如String,Number等)。
虽然DataType的迁移定义仅仅是:
class CreateDataTypes < ActiveRecord::Migration def self.up create_table :data_types do |t| t.string :name t.timestamps end end def self.down drop_table :data_types end end
谁能告诉我我做错了什么?
“属性”可能与某些东西发生冲突。 尝试重命名您的Attribute
模型。