2018-10-26 08:49:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Boards
|
|
|
|
module Visits
|
|
|
|
class CreateService < Boards::BaseService
|
|
|
|
def execute(board)
|
2021-08-02 05:10:09 -04:00
|
|
|
return unless current_user && Gitlab::Database.read_write?
|
2021-05-11 11:10:20 -04:00
|
|
|
return unless board
|
2018-10-26 08:49:16 -04:00
|
|
|
|
2021-05-11 11:10:20 -04:00
|
|
|
model.visited!(current_user, board)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def model
|
|
|
|
return BoardGroupRecentVisit if parent.is_a?(Group)
|
|
|
|
|
|
|
|
BoardProjectRecentVisit
|
2018-10-26 08:49:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|