fix association error

This commit is contained in:
Thein Lin Kyaw
2019-12-23 14:38:04 +06:30
parent bd91738c3b
commit 7f1246c6db

View File

@@ -6,7 +6,7 @@ class SaleAudit < ApplicationRecord
belongs_to :sale
belongs_to :sale_payments_for_credit, -> { where "SUBSTRING_INDEX(sale_audits.remark,'||',1) = sale_payments.sale_payment_id" }, foreign_key: "sale_id", primary_key: "sale_id", class_name: "SalePayment"
belongs_to :payments_for_credit, -> { where "SUBSTRING_INDEX(sale_audits.remark,'||',1) = sale_payments.sale_payment_id" }, foreign_key: "sale_id", primary_key: "sale_id", class_name: "SalePayment"
def self.sync_sale_audit_records(sale_audits)
if !sale_audits.nil?