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

20 lines
401 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
module Boards
module Visits
class LatestService < Boards::BaseService
def execute
2019-05-18 00:54:41 +05:30
return unless current_user
2018-12-13 13:39:08 +05:30
2019-05-18 00:54:41 +05:30
recent_visit_model.latest(current_user, parent, count: params[:count])
end
private
def recent_visit_model
parent.is_a?(Group) ? BoardGroupRecentVisit : BoardProjectRecentVisit
2018-12-13 13:39:08 +05:30
end
end
end
end