Redmine-Jobs/lib/time_entry_patch.rb

20 lines
297 B
Ruby
Raw Normal View History

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
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