Sha256: 44c539149be82e8c00e241d440d2d45aca52c0456004a13469853b6a2c180d90
Contents?: true
Size: 465 Bytes
Versions: 34
Compression:
Stored size: 465 Bytes
Contents
module Workarea module Admin module Reports class CustomersViewModel < ApplicationViewModel def results @results ||= model.results.map do |result| user = users.detect { |p| p.email == result['_id'] } OpenStruct.new({ user: user }.merge(result)) end end def users @users ||= User.any_in(email: model.results.map { |r| r['_id'] }).to_a end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems