diff --git a/ruby/lib/jam_ruby/models/promotional.rb b/ruby/lib/jam_ruby/models/promotional.rb index 987d2b55f..109b8bccd 100644 --- a/ruby/lib/jam_ruby/models/promotional.rb +++ b/ruby/lib/jam_ruby/models/promotional.rb @@ -129,6 +129,6 @@ class JamRuby::PromoLatest < JamRuby::Promotional end def self.active(max_count=10) - super.select { |pp| pp.latest.present? ? pp : nil }.compact + super.includes(:latest).select { |pp| pp.latest.present? ? pp : nil }.compact end end