Sha256: fa3281d83cd66d2c04e8f656f6ace575556aaa3241869d01f3714514848e7769
Contents?: true
Size: 1.15 KB
Versions: 6
Compression:
Stored size: 1.15 KB
Contents
module Katello class Candlepin::ProductContent include ForemanTasks::Triggers attr_accessor :content, :enabled, :product, :product_id def initialize(params = {}, product_id = nil) params = params.with_indifferent_access #controls whether repo is enabled in yum repo file on client # unrelated to enable/disable from katello @enabled = params[:enabled] @content = Candlepin::Content.new(params[:content]) @product_id = product_id end def create @content.create end def destroy @content.destroy end def product @product ||= Product.find(@product_id) if @product_id @product end def repositories @repos ||= self.product.repos(self.product.organization.library).where(:content_id => self.content.id) end def content_type self.content.type end def displayable? case content_type when ::Katello::Repository::CANDLEPIN_DOCKER_TYPE false when ::Katello::Repository::CANDLEPIN_OSTREE_TYPE ::Katello::RepositoryTypeManager.enabled?(Repository::OSTREE_TYPE) else true end end end end
Version data entries
6 entries across 6 versions & 1 rubygems