Module: Katello::Glue::Candlepin::Subscription::ClassMethods

Defined in:
app/models/katello/glue/candlepin/subscription.rb

Instance Method Summary collapse

Instance Method Details

#candlepin_data(org, cp_id) ⇒ Object



14
15
16
# File 'app/models/katello/glue/candlepin/subscription.rb', line 14

def candlepin_data(org, cp_id)
  Katello::Resources::Candlepin::Product.get(org, cp_id)[0]
end

#get_for_owner(organization) ⇒ Object



18
19
20
21
22
23
# File 'app/models/katello/glue/candlepin/subscription.rb', line 18

def get_for_owner(organization)
  Katello::Resources::Candlepin::Product.all(organization).select do |product|
    #this product's id is non-numeric (marketing product), or its a custom product
    !Glue::Candlepin::Product.engineering_product_id?(product['id']) || Katello::Product.find_by(:cp_id => product['id']).try(:custom?)
  end
end

#import_candlepin_records(cp_subs, org) ⇒ Object



25
26
27
28
# File 'app/models/katello/glue/candlepin/subscription.rb', line 25

def import_candlepin_records(cp_subs, org)
  cp_subs = cp_subs.reject { |cp_subscription| ::Katello::Glue::Provider.orphaned_custom_product?(cp_subscription['productId'], org) }
  super(cp_subs, org)
end