Sha256: c289601a277c1465ad0cad88ee7d9c69834deb8fb4dd449f4ef19528bd4dd061
Contents?: true
Size: 799 Bytes
Versions: 28
Compression:
Stored size: 799 Bytes
Contents
module Workarea module Storefront class UserActivityViewModel < ApplicationViewModel def products @products ||= begin product_ids = model.viewed.recent_product_ids(max: display_count, unique: true) Catalog::Product.find_ordered(product_ids).select(&:active?).map do |product| ProductViewModel.wrap(product, options) end end end def categories @categories ||= begin category_ids = model.viewed.recent_category_ids(max: display_count, unique: true) Catalog::Category.find_ordered(category_ids).select(&:active?) end end private def display_count Workarea.config.user_activity_display_size end end end end
Version data entries
28 entries across 28 versions & 1 rubygems