Sha256: ae483621d97d1db17d5f60f17fae83236b69111763da7ef55292f14c6282d931

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

module RhCloudHost
  extend ActiveSupport::Concern

  included do
    has_many(
      :inventory_upload_facts,
      -> { where(fact_name_id: ForemanInventoryUpload::Generators::Queries.fact_names.values) },
      class_name: 'FactValue',
      foreign_key: :host_id
    )

    has_many :insights_hits, through: :insights, source: :hits
    scoped_search :relation => :insights, :on => :hits_count, :only_explicit => true, :rename => :insights_recommendations_count

    has_one :insights_client_report_status_object, :class_name => '::InsightsClientReportStatus', :foreign_key => 'host_id'
    scoped_search :relation => :insights_client_report_status_object, :on => :status, :rename => :insights_client_report_status,
                  :complete_value => { :reporting => ::InsightsClientReportStatus::REPORTING,
                                       :no_report => ::InsightsClientReportStatus::NO_REPORT }

    has_one :inventory_sync_status_object, :class_name => '::InventorySync::InventoryStatus', :foreign_key => 'host_id'
    scoped_search :relation => :inventory_sync_status_object, :on => :status, :rename => :insights_inventory_sync_status,
                  :complete_value => { :disconnect => ::InventorySync::InventoryStatus::DISCONNECT,
                                       :sync => ::InventorySync::InventoryStatus::SYNC }
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
foreman_rh_cloud-9.0.59 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.58 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.57 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-10.0.1 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.56 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.55 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.54 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.53 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.52 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.52 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-9.0.51 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.51 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-7.0.48 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-7.0.47 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.50 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.49 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.48 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.47 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-8.0.46 app/models/concerns/rh_cloud_host.rb
foreman_rh_cloud-7.0.46 app/models/concerns/rh_cloud_host.rb