Welcome to mirror list, hosted at ThFree Co, Russian Federation.

create_service.rb « visits « boards « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4d6595968035ca1c1fc597c093e83719de97b694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Boards
  module Visits
    class CreateService < Boards::BaseService
      def execute(board)
        return unless current_user && Gitlab::Database.read_write?
        return unless board

        model.visited!(current_user, board)
      end

      private

      def model
        return BoardGroupRecentVisit if parent.is_a?(Group)

        BoardProjectRecentVisit
      end
    end
  end
end