debian-mirror-gitlab/app/services/boards/visits/create_service.rb
2021-06-08 01:23:25 +05:30

22 lines
435 B
Ruby

# 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