summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-17 17:05:27 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-23 17:11:49 +0900
commit9d56cb6a0d562ba7e2c9429af1d2ab0677871a37 (patch)
tree95bc6f5d7651998820ef15404ea61aa94230064e /app/serializers
parent361f85122b4d226224e6fc8c9e4beac940ff10bf (diff)
downloadgitlab-ce-9d56cb6a0d562ba7e2c9429af1d2ab0677871a37.tar.gz
Using fetch instead of direct refference for hash
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/build_serializer.rb2
-rw-r--r--app/serializers/pipeline_serializer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/build_serializer.rb b/app/serializers/build_serializer.rb
index 2c9cf99811e..c5dbb391ce0 100644
--- a/app/serializers/build_serializer.rb
+++ b/app/serializers/build_serializer.rb
@@ -7,6 +7,6 @@ class BuildSerializer < BaseSerializer
def represent_status(resource)
data = represent(resource, { only: [:status] })
- data[:status]
+ data.fetch(:status, {})
end
end
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb
index 62f31d4c5ad..384e881da06 100644
--- a/app/serializers/pipeline_serializer.rb
+++ b/app/serializers/pipeline_serializer.rb
@@ -25,6 +25,6 @@ class PipelineSerializer < BaseSerializer
def represent_status(resource)
data = represent(resource, { only: [{ details: [:status] }] })
- data[:details][:status]
+ data.fetch(:details, {}).fetch(:status, {})
end
end