From e39a522a6ce9511543d312aa296d148d02a4d9f2 Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Tue, 28 Apr 2020 13:56:01 +0200 Subject: [PATCH] Refs #29647 - remove implicit scopes --- app/models/katello/erratum.rb | 2 +- app/models/katello/product.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/katello/erratum.rb b/app/models/katello/erratum.rb index d696a36ba2a..81a7a82b021 100644 --- a/app/models/katello/erratum.rb +++ b/app/models/katello/erratum.rb @@ -48,7 +48,7 @@ def self.of_type(type) scope :security, -> { of_type(Erratum::SECURITY) } scope :bugfix, -> { of_type(Erratum::BUGZILLA) } scope :enhancement, -> { of_type(Erratum::ENHANCEMENT) } - scope :modular, -> { where(:id => Erratum.joins(:packages => :module_stream_errata_packages)) } + scope :modular, -> { where(:id => joins(:packages => :module_stream_errata_packages)) } scope :non_modular, -> { where.not(:id => modular) } def self.content_facet_association_class diff --git a/app/models/katello/product.rb b/app/models/katello/product.rb index 472d4ad6356..fe914a4e9c8 100644 --- a/app/models/katello/product.rb +++ b/app/models/katello/product.rb @@ -157,7 +157,7 @@ def used_by_another_org? self.class.where(["cp_id = ? AND id != ?", cp_id, id]).count > 0 end - scope :all_in_org, ->(org) { Product.joins(:provider).where("#{Katello::Provider.table_name}.organization_id = ?", org.id) } + scope :all_in_org, ->(org) { joins(:provider).where("#{Katello::Provider.table_name}.organization_id = ?", org.id) } def assign_unique_label self.label = Util::Model.labelize(self.name) if self.label.blank?