Sha256: 68a25a70ea25da4049b9b79133c5195bc6e0d66f8223f0d0d447b3698e4da36e
Contents?: true
Size: 644 Bytes
Versions: 62
Compression:
Stored size: 644 Bytes
Contents
module Workarea module Storefront class ShippingViewModel < ApplicationViewModel def items quantities .keys .map do |order_item_id| item = order.items.detect { |i| i.id.to_s == order_item_id } if item.present? copy = item.dup.tap { |c| c.quantity = quantities[order_item_id].to_i } Storefront::OrderItemViewModel.wrap(copy, options) end end .compact end def order options[:order] || Order.find(model.order_id) end def show_options? model.shippable? end end end end
Version data entries
62 entries across 62 versions & 1 rubygems