app/models/katello/pool.rb in katello-3.18.5 vs app/models/katello/pool.rb in katello-4.0.0.rc1
- old
+ new
@@ -20,10 +20,11 @@
scope :expiring_in_days, ->(days) do
return self if days.blank?
where(["end_date < ?", days.to_i.days.from_now.end_of_day])
end
scope :upstream, -> { where.not(upstream_pool_id: nil) }
+ scope :redhat, -> { joins(:products).merge(Katello::Product.redhat).distinct }
include Glue::Candlepin::Pool
include Glue::Candlepin::CandlepinObject
scoped_search :on => :cp_id, :complete_value => true, :rename => :id, :only_explicit => true
@@ -48,9 +49,13 @@
scoped_search :on => :pool_type, :complete_value => true, :rename => :type
validates_lengths_from_database
DAYS_RECENTLY_EXPIRED = 30
+
+ def redhat?
+ self.class.redhat.where(:id => self.id).exists?
+ end
def active?
active
end