From 324dda8b87662cc8819a64edfd1261f74b9d2737 Mon Sep 17 00:00:00 2001 From: Partha Aji Date: Wed, 11 Sep 2024 12:18:09 -0400 Subject: [PATCH] Removed from Content Facet also --- app/models/katello/host/content_facet.rb | 7 ------- test/models/content_view_test.rb | 4 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/models/katello/host/content_facet.rb b/app/models/katello/host/content_facet.rb index 5b09c72ad82..cf867a3281b 100644 --- a/app/models/katello/host/content_facet.rb +++ b/app/models/katello/host/content_facet.rb @@ -272,13 +272,6 @@ def self.in_content_view_version_environments(version_environments) relation.where(queries.join(" OR ")) end - def self.in_content_views_and_environments(content_views: nil, lifecycle_environments: nil) - relation = self.joins(:content_view_environment_content_facets => :content_view_environment) - relation = relation.where("#{::Katello::ContentViewEnvironment.table_name}.content_view_id" => content_views) if content_views - relation = relation.where("#{::Katello::ContentViewEnvironment.table_name}.environment_id" => lifecycle_environments) if lifecycle_environments - relation - end - def self.with_non_installable_errata(errata, hosts = nil) content_facets = Katello::Host::ContentFacet.select(:id).where(:host_id => hosts) reachable_repos = ::Katello::ContentFacetRepository.where(content_facet_id: content_facets).distinct.pluck(:repository_id) diff --git a/test/models/content_view_test.rb b/test/models/content_view_test.rb index afe5758ec00..f7820945f7e 100644 --- a/test/models/content_view_test.rb +++ b/test/models/content_view_test.rb @@ -437,9 +437,7 @@ def test_unique_environments end def test_check_remove_from_environment! - facets = ::Katello::Host::ContentFacet.in_content_views_and_environments( - lifecycle_environments: [@dev] - ) + facets = ::Katello::Host::ContentFacet.with_environments(@dev) host_ids = facets.joins(:host).select('hosts.id').pluck('hosts.id') facets.each do |facet| facet&.host&.subscription_facet&.destroy