Sha256: a12ea404579e9d36502f096caae8aa047da47ec98f79bd4aef9a9de0542e88f2
Contents?: true
Size: 461 Bytes
Versions: 28
Compression:
Stored size: 461 Bytes
Contents
module Workarea module Admin module Reports class SalesByCategoryViewModel < ApplicationViewModel def results @results ||= model.results.map do |result| OpenStruct.new({ category: categories[result['_id']] }.merge(result)) end end def categories @categories ||= Catalog::Category.any_in(id: model.results.map { |r| r['_id'] }).to_lookup_hash end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems