2023-11-22 19:44:13 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require_dependency 'time_entry'
|
|
|
|
|
|
|
|
module TimeEntryPatch
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
belongs_to :job
|
2023-12-05 14:25:24 +00:00
|
|
|
|
|
|
|
before_save :set_job, unless: :job
|
|
|
|
|
|
|
|
def set_job
|
|
|
|
return if job.present?
|
|
|
|
|
|
|
|
self.job = Job.default_for(self)
|
|
|
|
end
|
2023-11-22 19:44:13 +00:00
|
|
|
end
|
|
|
|
end
|