diff options
author | Rémy Coutable <remy@rymai.me> | 2017-02-13 10:22:38 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-02-13 10:22:38 +0000 |
commit | 6a1b3ef73f57d58d159e343f79e1f74418c2f763 (patch) | |
tree | 6e7c0bb5efbe28acba6728132952538ea399779a /app/models/concerns | |
parent | 59f44052d8753247a4a7435780fcb41b43e274ac (diff) | |
parent | 128b1eae092e4ee9384c99a4ba72b9122fc17e89 (diff) | |
download | gitlab-ce-6a1b3ef73f57d58d159e343f79e1f74418c2f763.tar.gz |
Merge branch 'zj-drop-ruby-21-tests' into 'master'
Update Rubocop to Ruby 2.3
See merge request !8994
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/issuable.rb | 4 | ||||
-rw-r--r-- | app/models/concerns/milestoneish.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 3517969eabc..d1872dd931d 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -95,8 +95,8 @@ module Issuable def update_assignee_cache_counts # make sure we flush the cache for both the old *and* new assignees(if they exist) previous_assignee = User.find_by_id(assignee_id_was) if assignee_id_was - previous_assignee.update_cache_counts if previous_assignee - assignee.update_cache_counts if assignee + previous_assignee&.update_cache_counts + assignee&.update_cache_counts end # We want to use optimistic lock for cases when only title or description are involved diff --git a/app/models/concerns/milestoneish.rb b/app/models/concerns/milestoneish.rb index e9450dd0c26..f449229864d 100644 --- a/app/models/concerns/milestoneish.rb +++ b/app/models/concerns/milestoneish.rb @@ -73,7 +73,7 @@ module Milestoneish def memoize_per_user(user, method_name) @memoized ||= {} @memoized[method_name] ||= {} - @memoized[method_name][user.try!(:id)] ||= yield + @memoized[method_name][user&.id] ||= yield end # override in a class that includes this module to get a faster query |