

在做depot练习时遇到问题,请教
我在做depot练习,遇到不少问题:
开始时遇到scaffold的问题,换了老一些版本的InstantRails解决了.
现在做到往products表中添加一price字段.
运行rake db:migrate数据迁移时,出现错误如下:
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
查了好久也解决不了,不知何故,请朋友们指教.
相关代码和图片如下:
002_add_price:
class AddPrice < ActiveRecord::Migration
def self.up
add_column:products,:price,:decimal,:precision=>8,:scale=>2,:default=>0
end
def self.down
remove_column:products,:price
end
end
附件: 您所在的用户组无法下载或查看附件