0
在訂單確認上,賣家和用戶都會收到確認信息,但添加seller_id或buyer_id導軌後會吐出錯誤!Rails如何讓郵件上的foreign_key?
我期待在那裏發售者作爲一個解決方案,但沒有找到具體的ID
有人有一個想法如何通過在郵件的foreign_key?
感謝的
class Order < ActiveRecord::Base
belongs_to :seller, foreign_key: 'seller_id', class_name: 'Shop'
belongs_to :buyer, foreign_key: 'buyer_id', class_name: 'User'
end
def order_confirmation(order)
@order = order
@buyer = Order.where('buyer_id')
mail(to: @buyer.email, subject: 'confirmation', &:html)
end
def order_confirmation_seller(order)
@order = order
@seller = Order.where('seller_id')
mail(to: @seller.email, subject: 'confirmation', &:html)
end