2013-08-07 67 views
0

似乎在模型獲取未初始化的常量

class LineItemAddons < ActiveRecord::Base 
    belongs_to :line_item 
    has_one :addon_type_value 
    attr_accessible :quantity, :received, :snapshot_price, :status, :line_item_id, :addon_type_value_id 

class LineItem < ActiveRecord::Base 
    belongs_to :design 
    belongs_to :cart 
    belongs_to :designer_order 
    belongs_to :return 
    belongs_to :return_designer_order 
    has_many :line_item_addons 

class AddonTypeValue < ActiveRecord::Base 
    belongs_to :design 
    belongs_to :addon_type 
    belongs_to :line_item_addon 
    attr_accessible :description, :name, :position, :price, :addon_type_id, :design_id, :quantity 

做了一些錯誤的入門line_item_addons

回答

0

刪除belongs_to :line_item_addon我犯了一個錯誤,同時生成模型

類的名稱應該LineItemAddon不LineItemAddons

對不起你們

0

我覺得應該是unintialized不斷

class AddonTypeValue < ActiveRecord::Base 
    belongs_to :design 
    belongs_to :addon_type 
    belongs_to :line_item_addons 
    ... 
相關問題