diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-05-08 18:00:51 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-05-09 19:08:37 +0300 |
commit | 890dc39ee0c92adb10a3221c2a564533e038a72c (patch) | |
tree | c4f2e00d6c6786f0369597e6a586dd6f295edc37 /app/models/concerns/time_trackable.rb | |
parent | 533593e95cd3a922a2ec2ea43b345862361dfd67 (diff) |
Updates updated_at on issue when using /spend quick action
Diffstat (limited to 'app/models/concerns/time_trackable.rb')
-rw-r--r-- | app/models/concerns/time_trackable.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/concerns/time_trackable.rb b/app/models/concerns/time_trackable.rb index 5911b56c34c..73fc5048dcf 100644 --- a/app/models/concerns/time_trackable.rb +++ b/app/models/concerns/time_trackable.rb @@ -30,6 +30,8 @@ module TimeTrackable return if @time_spent == 0 + touch if touchable? + if @time_spent == :reset reset_spent_time else @@ -53,6 +55,10 @@ module TimeTrackable private + def touchable? + valid? && persisted? + end + def reset_spent_time timelogs.new(time_spent: total_time_spent * -1, user: @time_spent_user) # rubocop:disable Gitlab/ModuleWithInstanceVariables end |