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

18 lines
373 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-30 16:15:17 +05:30
return nil unless current_user
2018-12-13 13:39:08 +05:30
2019-05-30 16:15:17 +05:30
if parent.is_a?(Group)
BoardGroupRecentVisit.latest(current_user, parent)
else
BoardProjectRecentVisit.latest(current_user, parent)
end
2018-12-13 13:39:08 +05:30
end
end
end
end