<分区>
我试图在我的迁移中创建记录,但我遇到了麻烦我以前做过(在我的高级开发人员的帮助下)并且我试图复制他所做的但它似乎没有创建记录数据库...
这是迁移文件
class PageEditor < ActiveRecord::Base; end
def create_initial_record
PageEditor.create({
:title => 'Events & Training',
:content => ''
})
PageEditor.create({
:title => 'Roof Mount - Training',
:content => ''
})
end
class CreatePageEditors < ActiveRecord::Migration
def up
create_table :page_editors do |t|
t.string :title
t.text :content
t.timestamps
end
create_initial_record
end
def down
drop_table :page_editors
end
end
所以我添加了屋顶安装 - 训练部分,然后运行了 rake db:migrate 但它没有创建记录,也没有显示在我的索引页面上......