Sha256: 99c969539548447e7b655191fc2f10d6e3784aba1e35d8676c1c419959ee8eaf
Contents?: true
Size: 689 Bytes
Versions: 27
Compression:
Stored size: 689 Bytes
Contents
module Katello module Validators class AlternateContentSourceProductsValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value if attribute == :product_id product = ::Katello::Product.find(value) content_type = record.alternate_content_source.content_type if product.repositories.with_type(content_type).has_url.empty? record.errors[attribute] << N_("The product %{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type } end end end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems