diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-21 16:26:47 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-21 16:26:47 +0300 |
commit | c8b16068be28699da42e1d19a02dc913071919ac (patch) | |
tree | b265fba4ab8e19e4d795231f439e9231daf2e9eb /app/serializers/pipeline_serializer.rb | |
parent | 9f47d317c547eb49c59e01f9c5a887b9ffb7f500 (diff) |
Add specs for pipeline entity and improve factory
[ci skip]
Diffstat (limited to 'app/serializers/pipeline_serializer.rb')
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index c4ca5c40dba..76c767f82c0 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -3,14 +3,6 @@ class PipelineSerializer < BaseSerializer include API::Helpers::Pagination Struct.new('Pagination', :request, :response) - def with_pagination(request, response) - tap { @pagination = Struct::Pagination.new(request, response) } - end - - def paginate? - defined?(@pagination) - end - def represent(resource, opts = {}) if paginate? super(paginate(resource), opts) @@ -19,6 +11,14 @@ class PipelineSerializer < BaseSerializer end end + def paginate? + defined?(@pagination) + end + + def with_pagination(request, response) + tap { @pagination = Struct::Pagination.new(request, response) } + end + private # Methods needed by `API::Helpers::Pagination` |