Sha256: dc7e8dff19b1bf3acf2d78fe6772d9bc462b9a67b50496986bf239b168a383de

Contents?: true

Size: 535 Bytes

Versions: 34

Compression:

Stored size: 535 Bytes

Contents

module Workarea
  module Admin
    class RecommendationsViewModel < ApplicationViewModel
      def sources_display
        t('workarea.admin.recommendations.sources')
      end

      def products
        @products ||=
          begin
            models = Catalog::Product.any_in(id: product_ids).to_a

            product_ids.map do |id|
              model = models.detect { |m| m.id == id }
              next unless model

              ProductViewModel.new(model)
            end.compact
          end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-admin-3.4.25 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.24 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.23 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.22 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.21 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.20 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.19 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.18 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.17 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.16 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.15 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.14 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.13 app/view_models/workarea/admin/recommendations_view_model.rb
workarea-admin-3.4.12 app/view_models/workarea/admin/recommendations_view_model.rb