我最近使用ActiveRecord
. 这是创建表的初始迁移:
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :content
t.timestamps
end
end
end
我稍后通过此迁移向其中添加了一个字段:
class AddPrivateToPosts < ActiveRecord::Migration
def change
add_column :posts, :private, :boolean
end
end
每当我调用Post.create("Title", "Content", true)
orPost.create!("Title", "Content", true)
时,我都会收到too many arguments
错误消息。有人可以帮我吗?