diff --git a/app/models/katello/activation_key.rb b/app/models/katello/activation_key.rb index ebc886977ad..650340fdd03 100644 --- a/app/models/katello/activation_key.rb +++ b/app/models/katello/activation_key.rb @@ -190,7 +190,7 @@ def available_releases end def content_view_environment_labels - content_view_environment_names.join(',') + content_view_environments.map(&:label).join(',') end def available_subscriptions diff --git a/app/models/katello/host/content_facet.rb b/app/models/katello/host/content_facet.rb index 551a238c728..310934c4543 100644 --- a/app/models/katello/host/content_facet.rb +++ b/app/models/katello/host/content_facet.rb @@ -127,6 +127,10 @@ def content_view_environments=(new_cves) self.host&.update_candlepin_associations unless self.host&.new_record? end + def content_view_environment_labels + content_view_environments.map(&:label).join(',') + end + # rubocop:disable Metrics/CyclomaticComplexity def assign_single_environment( content_view_id: nil, lifecycle_environment_id: nil, environment_id: nil, diff --git a/app/views/katello/api/v2/content_facet/base.json.rabl b/app/views/katello/api/v2/content_facet/base.json.rabl index 77fc616b4df..2f1cec206fc 100644 --- a/app/views/katello/api/v2/content_facet/base.json.rabl +++ b/app/views/katello/api/v2/content_facet/base.json.rabl @@ -32,6 +32,8 @@ child :content_view_environments => :content_view_environments do end end +attributes :content_view_environment_labels + node :multi_content_view_environment do |content_facet| content_facet.multi_content_view_environment? end