diff options
Diffstat (limited to 'app/models/concerns/time_trackable.rb')
-rw-r--r-- | app/models/concerns/time_trackable.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/concerns/time_trackable.rb b/app/models/concerns/time_trackable.rb index 89b42eec727..54fe9eac2bc 100644 --- a/app/models/concerns/time_trackable.rb +++ b/app/models/concerns/time_trackable.rb @@ -11,7 +11,7 @@ module TimeTrackable extend ActiveSupport::Concern included do - attr_reader :time_spent, :time_spent_user, :spent_at + attr_reader :time_spent, :time_spent_user, :spent_at, :summary alias_method :time_spent?, :time_spent @@ -20,7 +20,7 @@ module TimeTrackable validates :time_estimate, numericality: { message: 'has an invalid format' }, allow_nil: false validate :check_negative_time_spent - has_many :timelogs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent + has_many :timelogs, dependent: :destroy, autosave: true # rubocop:disable Cop/ActiveRecordDependent end # rubocop:disable Gitlab/ModuleWithInstanceVariables @@ -29,6 +29,7 @@ module TimeTrackable @time_spent_note_id = options[:note_id] @time_spent_user = User.find(options[:user_id]) @spent_at = options[:spent_at] + @summary = options[:summary] @original_total_time_spent = nil return if @time_spent == 0 @@ -78,7 +79,8 @@ module TimeTrackable time_spent: time_spent, note_id: @time_spent_note_id, user: @time_spent_user, - spent_at: @spent_at + spent_at: @spent_at, + summary: @summary ) end # rubocop:enable Gitlab/ModuleWithInstanceVariables |