custom primary key for transaction

This commit is contained in:
Min Zeya Phyo
2017-06-04 16:27:14 +06:30
parent 394d2ed938
commit 4fc511d531
19 changed files with 88 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
class SaleAudit < ApplicationRecord
#primary key - need to be unique generated for multiple shops
#primary key - need to be unique generated for multiple shops
belongs_to :sale
def record_audit_void(sale_id, void_by, approved_by, reason)
@@ -50,4 +50,9 @@ class SaleAudit < ApplicationRecord
sale_audit.remark = remark
sale_audit.save!
end
private
def generate_custom_id
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
end
end