summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-07 13:13:33 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-07 13:13:33 +0100
commit8753635c44f53c1b7b0266c66f36bf8134680d1a (patch)
tree72b4ed8a2eb5b59cee01833747d8fb0c3d941b54 /app/serializers
parente4cb073bc037856b3d31e79c081e7ed0d330bdc2 (diff)
downloadgitlab-ce-8753635c44f53c1b7b0266c66f36bf8134680d1a.tar.gz
Use `#present?` instead of `defined?` in serializers
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/environment_serializer.rb2
-rw-r--r--app/serializers/pipeline_serializer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index b615d01d4f9..fe16a3784c4 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -16,7 +16,7 @@ class EnvironmentSerializer < BaseSerializer
end
def paginated?
- defined?(@paginator)
+ @paginator.present?
end
def represent(resource, opts = {})
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb
index 245298db3c3..2bc6cf3266e 100644
--- a/app/serializers/pipeline_serializer.rb
+++ b/app/serializers/pipeline_serializer.rb
@@ -8,7 +8,7 @@ class PipelineSerializer < BaseSerializer
end
def paginated?
- defined?(@paginator)
+ @paginator.present?
end
def represent(resource, opts = {})