Sha256: e38dbd87c8adad2cbdf8382acb96e9d7063028c803746acbba7a8623029dac0e
Contents?: true
Size: 500 Bytes
Versions: 8
Compression:
Stored size: 500 Bytes
Contents
module Ecom module Core class CrewTime < ApplicationRecord belongs_to :crew belongs_to :overtime_type, optional: true validates :date, :hours, :converted_hours, presence: true before_save :calculate_converted_hours def calculate_converted_hours if overtime rate = OvertimeType.find(overtime_type_id).rate self.converted_hours = hours * rate else self.converted_hours = hours end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems