diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-11-22 10:50:36 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-22 12:06:57 +0300 |
commit | 07d3d44775f6cc5b7a1b768cb4e5b7900d543815 (patch) | |
tree | 9b87200493dfc56a64aa6716ff4f03794b8f24c3 /app/models/concerns/time_trackable.rb | |
parent | 15edf741a14a53443fb39ecb59888e75697b9c2b (diff) |
Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
Diffstat (limited to 'app/models/concerns/time_trackable.rb')
-rw-r--r-- | app/models/concerns/time_trackable.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/concerns/time_trackable.rb b/app/models/concerns/time_trackable.rb index f1b43cb38e1..fc44a7da178 100644 --- a/app/models/concerns/time_trackable.rb +++ b/app/models/concerns/time_trackable.rb @@ -20,7 +20,7 @@ module TimeTrackable has_many :timelogs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent end - # rubocop:disable Cop/ModuleWithInstanceVariables + # rubocop:disable Gitlab/ModuleWithInstanceVariables def spend_time(options) @time_spent = options[:duration] @time_spent_user = options[:user] @@ -36,7 +36,7 @@ module TimeTrackable end end alias_method :spend_time=, :spend_time - # rubocop:enable Cop/ModuleWithInstanceVariables + # rubocop:enable Gitlab/ModuleWithInstanceVariables def total_time_spent timelogs.sum(:time_spent) @@ -53,10 +53,10 @@ module TimeTrackable private def reset_spent_time - timelogs.new(time_spent: total_time_spent * -1, user: @time_spent_user) # rubocop:disable Cop/ModuleWithInstanceVariables + timelogs.new(time_spent: total_time_spent * -1, user: @time_spent_user) # rubocop:disable Gitlab/ModuleWithInstanceVariables end - # rubocop:disable Cop/ModuleWithInstanceVariables + # rubocop:disable Gitlab/ModuleWithInstanceVariables def add_or_subtract_spent_time timelogs.new( time_spent: time_spent, @@ -64,7 +64,7 @@ module TimeTrackable spent_at: @spent_at ) end - # rubocop:enable Cop/ModuleWithInstanceVariables + # rubocop:enable Gitlab/ModuleWithInstanceVariables def check_negative_time_spent return if time_spent.nil? || time_spent == :reset |