【发布时间】:2014-12-20 06:25:04
【问题描述】:
鉴于这段代码:
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.string :commenter
t.text :body
t.references :article, index: true
t.timestamps
end
end
end
我了解 CreateComments 继承自 Migration 的方法。但是什么是迁移到 ActiveRecord?与其他语言相比,我在 ActiveRecord 类中找不到任何名为 Migration 的成员。那么:: 是什么意思呢?在这种情况下,您将什么称为迁移?
【问题讨论】:
标签: ruby-on-rails ruby activerecord