summaryrefslogtreecommitdiff
path: root/app/serializers/pipeline_serializer.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-04 18:04:33 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:46:49 +0200
commitca538899b66a6a82582d2d590297cfef1d310dcf (patch)
tree7ecddf4e410aff8afde79345364b536976626385 /app/serializers/pipeline_serializer.rb
parent063b5312111ccea62f84fa9f68a2262dc1f66e64 (diff)
downloadgitlab-ce-ca538899b66a6a82582d2d590297cfef1d310dcf.tar.gz
Add a `WithPagination` concern to reuse across serializers
Diffstat (limited to 'app/serializers/pipeline_serializer.rb')
-rw-r--r--app/serializers/pipeline_serializer.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb
index 661bf17983c..7181f8a6b04 100644
--- a/app/serializers/pipeline_serializer.rb
+++ b/app/serializers/pipeline_serializer.rb
@@ -1,16 +1,10 @@
class PipelineSerializer < BaseSerializer
+ include WithPagination
+
InvalidResourceError = Class.new(StandardError)
entity PipelineDetailsEntity
- def with_pagination(request, response)
- tap { @paginator = Gitlab::Serializer::Pagination.new(request, response) }
- end
-
- def paginated?
- @paginator.present?
- end
-
def represent(resource, opts = {})
if resource.is_a?(ActiveRecord::Relation)