summaryrefslogtreecommitdiff
path: root/app/services/boards/visits/latest_service.rb
blob: 9e4c77a63174a2016ab1143c10a635e507eb8d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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