In development environment everything works fine but in production (when deployed to Heroku) it throws me MissingAttributeError.
class Order < ApplicationRecord
has_many :cart_items, dependent: :destroy
end
class CartItem < ApplicationRecord
belongs_to :order, optional: true, foreign_key: "order_id"
end
create_table "cart_items", force: :cascade do |t|
t.integer "item_id"
t.integer "cart_id"
t.integer "user_id"
t.integer "order_id"
end