gitlab-org--gitlab-foss/app/services/boards/visits/latest_service.rb
2018-10-26 12:49:16 +00:00

17 lines
373 B
Ruby

# frozen_string_literal: true
module Boards
module Visits
class LatestService < Boards::BaseService
def execute
return nil unless current_user
if parent.is_a?(Group)
BoardGroupRecentVisit.latest(current_user, parent)
else
BoardProjectRecentVisit.latest(current_user, parent)
end
end
end
end
end