Class: Workarea::Admin::FulfillmentSkuViewModel

Inherits:
ApplicationViewModel
  • Object
show all
Defined in:
app/view_models/workarea/admin/fulfillment_sku_view_model.rb

Instance Method Summary collapse

Instance Method Details

#productObject



13
14
15
16
17
18
19
# File 'app/view_models/workarea/admin/fulfillment_sku_view_model.rb', line 13

def product
  @product ||=
    begin
      product = Catalog::Product.find_by_sku(model.id)
      ProductViewModel.wrap(product, options) if product.present?
    end
end

#timelineObject



4
5
6
# File 'app/view_models/workarea/admin/fulfillment_sku_view_model.rb', line 4

def timeline
  @timeline ||= TimelineViewModel.new(model)
end

#tokensObject



8
9
10
11
# File 'app/view_models/workarea/admin/fulfillment_sku_view_model.rb', line 8

def tokens
  return [] unless download?
  @tokens ||= Fulfillment::Token.for_sku(id)
end