Sha256: c4f360f854e73df93c916faa4cbb8df45866d1bb92af42c95ea06e0f99dde0da
Contents?: true
Size: 676 Bytes
Versions: 4
Compression:
Stored size: 676 Bytes
Contents
module Workarea module Admin module FeaturedBrowseOptionProductsViewModel def featured_products @featured_products ||= begin models = Catalog::Product.any_in(id: model.unique_product_ids).to_a results = model.product_ids.map do |id| id, option = BrowseOptionIds.split(id) tmp = models.detect { |m| m.id == id } next unless tmp.present? Admin::FeaturedBrowseOptionProductViewModel.new( tmp, tmp.browse_option => option&.optionize ) end results.compact end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems