Files
sx-fc/app/models/cashier_login_log.rb
2019-06-18 13:35:15 +06:30

16 lines
346 B
Ruby
Executable File

class CashierLoginLog < ApplicationRecord
before_create :generate_custom_id
belongs_to :cashier_station
belongs_to :employee
private
def generate_custom_id
prefix = "CLO"
if ENV["SERVER_MODE"] == 'cloud'
prefix = "CCLO"
end
self.cashier_login_log_id = SeedGenerator.generate_id(self.class.name, prefix)
end
end