diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 03:10:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 03:10:50 +0300 |
commit | 271e563cf65b75346f55cd496259a5673c7ff1ea (patch) | |
tree | b02cc773f538c1719b70ea9d8a207de9efa64719 /app/services/boards | |
parent | c57962295c5f577de7f738ef710da33cb76354b4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/boards')
-rw-r--r-- | app/services/boards/visits/create_service.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/services/boards/visits/create_service.rb b/app/services/boards/visits/create_service.rb index 428ed1a8bcc..4d659596803 100644 --- a/app/services/boards/visits/create_service.rb +++ b/app/services/boards/visits/create_service.rb @@ -5,13 +5,17 @@ module Boards class CreateService < Boards::BaseService def execute(board) return unless current_user && Gitlab::Database.read_write? - return unless board.is_a?(Board) # other board types do not support board visits yet + return unless board - if parent.is_a?(Group) - BoardGroupRecentVisit.visited!(current_user, board) - else - BoardProjectRecentVisit.visited!(current_user, board) - end + model.visited!(current_user, board) + end + + private + + def model + return BoardGroupRecentVisit if parent.is_a?(Group) + + BoardProjectRecentVisit end end end |