Sha256: 70ff185ea81dcf75a4fac6e0af10f8dfbb49549d394ba4980b9d16058d198b33
Contents?: true
Size: 1020 Bytes
Versions: 10
Compression:
Stored size: 1020 Bytes
Contents
module Katello class Candlepin::ProductContent include ForemanTasks::Triggers attr_accessor :content, :enabled, :product 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_override(activation_key) override = activation_key.content_overrides.find { |pc| pc[:contentLabel] == content.label } override.nil? ? 'default' : override[:value] end end end
Version data entries
10 entries across 10 versions & 1 rubygems