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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-02-27 16:08:48 +0300
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-03-01 14:47:52 +0300
commitc5b3b71e89996ba4e6fb977e3cbb3eebfbbfed4e (patch)
treef00ba49189df8a72f647c33c4670534f70c7cc64 /app/services/boards
parent31353188f84bd3e57318b4b1aa2da93a9d9605d1 (diff)
CE-port for 7714-view-recent-boards
Adds additional count param to Boards::Visits::LatestService
Diffstat (limited to 'app/services/boards')
-rw-r--r--app/services/boards/visits/latest_service.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/services/boards/visits/latest_service.rb b/app/services/boards/visits/latest_service.rb
index 9e4c77a6317..d8de08c5844 100644
--- a/app/services/boards/visits/latest_service.rb
+++ b/app/services/boards/visits/latest_service.rb
@@ -6,11 +6,13 @@ module Boards
def execute
return nil unless current_user
- if parent.is_a?(Group)
- BoardGroupRecentVisit.latest(current_user, parent)
- else
- BoardProjectRecentVisit.latest(current_user, parent)
- end
+ 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