Sha256: a9417ee6af00c5e4e9aa34f793a811029d2ee9bba64243d4cc5e7ddf3362199a
Contents?: true
Size: 1.11 KB
Versions: 3
Compression:
Stored size: 1.11 KB
Contents
module Katello class InstalledProduct < Katello::Model has_many :subscription_facet_installed_products, :class_name => "Katello::SubscriptionFacetInstalledProduct", :dependent => :destroy, :inverse_of => :installed_product has_many :subscription_facets, :through => :subscription_facet_installed_products, :class_name => "Katello::Host::SubscriptionFacet" alias_attribute :product_id, :cp_product_id alias_attribute :product_name, :name def self.find_or_create_from_consumer(consumer_attributes) attributes = { :arch => consumer_attributes['arch'], :version => consumer_attributes['version'], :name => consumer_attributes['productName'], :cp_product_id => consumer_attributes['productId'], } Katello::Util::Support.active_record_retry do unless self.where(attributes).exists? self.create!(attributes) end end self.where(attributes).first end def consumer_attributes { :arch => arch, :version => version, :productName => name, :productId => cp_product_id, } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
katello-4.15.0 | app/models/katello/installed_product.rb |
katello-4.15.0.rc2 | app/models/katello/installed_product.rb |
katello-4.15.0.rc1 | app/models/katello/installed_product.rb |