diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-06 14:47:56 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-06 14:47:56 +0100 |
commit | 81eb5c7fd79897d63e733e99b8fc4424dc8ea38a (patch) | |
tree | 7394e22be3d6237a74e4cef2434a28c84620c4fe /app/serializers | |
parent | 10c1a4d8e4828992afa56bfca6b61eeb328d851e (diff) | |
download | gitlab-ce-81eb5c7fd79897d63e733e99b8fc4424dc8ea38a.tar.gz |
Move serializers pagination class to separate module
This helps to avoid conflicts with `Paginator` class that seems to be
used by some bundled libs.
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/environment_serializer.rb | 2 | ||||
-rw-r--r-- | app/serializers/paginator.rb | 23 | ||||
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 2 |
3 files changed, 2 insertions, 25 deletions
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb index d1991f0f2f1..5e8634e05d0 100644 --- a/app/serializers/environment_serializer.rb +++ b/app/serializers/environment_serializer.rb @@ -8,7 +8,7 @@ class EnvironmentSerializer < BaseSerializer end def with_pagination(request, response) - tap { @paginator = Paginator.new(request, response) } + tap { @paginator = Gitlab::Serializer::Pagination.new(request, response) } end def itemized? diff --git a/app/serializers/paginator.rb b/app/serializers/paginator.rb deleted file mode 100644 index c5e38a9c8b5..00000000000 --- a/app/serializers/paginator.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Paginator - include API::Helpers::Pagination - - def initialize(request, response) - @request = request - @response = response - end - - private - - # Methods needed by `API::Helpers::Pagination` - # - - attr_reader :request - - def params - @request.query_parameters - end - - def header(header, value) - @response.headers[header] = value - end -end diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 7c8dfad3b4b..731ccfe90b3 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -4,7 +4,7 @@ class PipelineSerializer < BaseSerializer entity PipelineEntity def with_pagination(request, response) - tap { @paginator = Paginator.new(request, response) } + tap { @paginator = Gitlab::Serializer::Pagination.new(request, response) } end def paginated? |