Katello/katello

View on GitHub
app/views/katello/api/v2/alternate_content_sources/show.json.rabl

Summary

Maintainability
Test Coverage
object @resource

extends "katello/api/v2/alternate_content_sources/base"

if @resource.respond_to?(:simplified?)
  if @resource.simplified?
    node :products do |acs|
      acs.products.map do |product|
        { id: product.id, organization_id: product.organization.id, name: product.name, label: product.label }
      end
    end
  else
    node :upstream_password_exists do |_acs|
      @resource.upstream_password.present?
    end
  end
end

node :smart_proxies do |acs|
  acs.smart_proxies.map do |smart_proxy|
    { id: smart_proxy.id, name: smart_proxy.name, url: smart_proxy.url, download_policy: smart_proxy.download_policy }
  end
end