debian-mirror-gitlab/app/services/boards/visits/latest_service.rb
2019-05-18 00:54:41 +05:30

19 lines
401 B
Ruby

# 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