diff --git a/ruby/lib/jam_ruby/models/promotional.rb b/ruby/lib/jam_ruby/models/promotional.rb index 407a30c1e..987d2b55f 100644 --- a/ruby/lib/jam_ruby/models/promotional.rb +++ b/ruby/lib/jam_ruby/models/promotional.rb @@ -128,4 +128,7 @@ class JamRuby::PromoLatest < JamRuby::Promotional .map(&:latest) end + def self.active(max_count=10) + super.select { |pp| pp.latest.present? ? pp : nil }.compact + end end