我正在通过Ruby on Rails tutorial工作,并仅创建了一个带有三个属性的Comment模型。Rails模型属性位置
rails generate model Comment commenter:string body:text post:references
它产生一个ActiveRecord类post
但不commenter
和body
。
class Comment < ActiveRecord::Base
belongs_to :post
end
为什么rails没有正式定义除数据库迁移脚本以外的任何地方的非引用属性?