fetch to dig

This commit is contained in:
Shinya Maeda 2017-03-21 21:15:20 +09:00
parent c4441c623e
commit 6dcd2d591f

View file

@ -25,6 +25,6 @@ class PipelineSerializer < BaseSerializer
def represent_status(resource)
data = represent(resource, { only: [{ details: [:status] }] })
data.fetch(:details, {}).fetch(:status, {})
data.dig(:details, :status) || {}
end
end