Why do I get an Unknown Primary Key exception for a join table in Rails 4?

后端 未结 5 519
情歌与酒
情歌与酒 2021-01-04 09:21

These are my models:

class Product
  has_many :line_items
  has_many :orders, :through => :line_items
end

class LineItem 
  belongs_to :order
  belongs_t         


        
5条回答
  •  走了就别回头了
    2021-01-04 09:45

    I had this error, but dropping my local database with rake db:drop and then creating with rake db:create before running pg_restore with the heroku db dump solved it.

提交回复
热议问题