debian-mirror-gitlab/app/services/boards/visits/create_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
435 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
module Boards
module Visits
class CreateService < Boards::BaseService
def execute(board)
return unless current_user && Gitlab::Database.read_write?
2021-06-08 01:23:25 +05:30
return unless board
2018-12-13 13:39:08 +05:30
2021-06-08 01:23:25 +05:30
model.visited!(current_user, board)
end
private
def model
return BoardGroupRecentVisit if parent.is_a?(Group)
BoardProjectRecentVisit
2018-12-13 13:39:08 +05:30
end
end
end
end