diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-17 11:05:27 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-23 11:11:49 +0300 |
commit | 9d56cb6a0d562ba7e2c9429af1d2ab0677871a37 (patch) | |
tree | 95bc6f5d7651998820ef15404ea61aa94230064e /app/serializers | |
parent | 361f85122b4d226224e6fc8c9e4beac940ff10bf (diff) |
Using fetch instead of direct refference for hash
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/build_serializer.rb | 2 | ||||
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 2 |
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 |