class ServiceSerializer < ActiveModel::Serializer
  attributes :name, :command, :cpu, :memory, :load_balancer, :status

  belongs_to :heritage

  def load_balancer
    lb = object.fetch_load_balancer
    if lb.nil?
      nil
    else
      {
        name: lb.load_balancer_name,
        dns_name: lb.dns_name
      }
    end
  end
end

class ServiceSerializer < ActiveModel::Serializer
  attributes :name, :public, :command, :cpu, :memory, :load_balancer, :status, :port_mappings

  belongs_to :heritage

  def load_balancer
    lb = object.fetch_load_balancer
    if lb.nil?
      nil
    else
      {
        name: lb.load_balancer_name,
        dns_name: lb.dns_name
      }
    end
  end
end

Add port_mappings to service serializer
Add port_mappings to service serializer
