product commission transaction in commissioner
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
class Commission < ApplicationRecord
|
||||
self.primary_key = 'commission_id'
|
||||
|
||||
# primary key - need to be unique
|
||||
before_create :generate_custom_id
|
||||
|
||||
belongs_to :menu_item, foreign_key: 'product_code'
|
||||
has_many :commissioners
|
||||
has_many :product_commissions
|
||||
|
||||
private
|
||||
|
||||
def generate_custom_id
|
||||
self.commission_id = SeedGenerator.generate_id(self.class.name, 'COM')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user