Using fetch instead of direct refference for hash
This commit is contained in:
parent
361f85122b
commit
9d56cb6a0d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue