Welcome to mirror list, hosted at ThFree Co, Russian Federation.

latest_service.rb « visits « boards « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d13e25b4f12ff956a75393332e2fb6f6708f21e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Boards
  module Visits
    class LatestService < Boards::BaseService
      def execute
        return unless current_user

        recent_visit_model.latest(current_user, parent, count: params[:count])
      end

      private

      def recent_visit_model
        parent.is_a?(Group) ? BoardGroupRecentVisit : BoardProjectRecentVisit
      end
    end
  end
end