Commit 9d56cb6a authored by Shinya Maeda's avatar Shinya Maeda

Using fetch instead of direct refference for hash

parent 361f8512
......@@ -7,6 +7,6 @@ class BuildSerializer < BaseSerializer
def represent_status(resource)
data = represent(resource, { only: [:status] })
data[:status]
data.fetch(:status, {})
end
end
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment