diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 15:10:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 15:10:20 +0000 |
commit | e3042fc5ced749e693ccef81b3f5838c55d5480c (patch) | |
tree | e004dca26da0ec413d5c9ebf174962a008fde0bb /app/services/boards | |
parent | c33a9adb709ffb40f816e66eb0c98cc750d6cd43 (diff) | |
download | gitlab-ce-e3042fc5ced749e693ccef81b3f5838c55d5480c.tar.gz |
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 |