Sha256: da7b9cf4a538e1da8d8a5b67bd8a6f5019e1fabd6ee7574fbdf0333a477542a2

Contents?: true

Size: 406 Bytes

Versions: 28

Compression:

Stored size: 406 Bytes

Contents

module Workarea
  module Admin
    class FulfillmentTokenViewModel < ApplicationViewModel
      def order
        return unless order_id.present?
        @order ||= options[:order] || Order.find(order_id)
      end

      def order_item
        return unless order.present? && order_item_id.present?
        @order_item ||= order.items.detect { |i| i.id.to_s == order_item_id }
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.26 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.25 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.23 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.22 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.21 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.20 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.19 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.18 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.17 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.16 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.15 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.14 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.13 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.12 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.11 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.10 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.9 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.8 app/view_models/workarea/admin/fulfillment_token_view_model.rb
workarea-admin-3.5.7 app/view_models/workarea/admin/fulfillment_token_view_model.rb