Sha256: 4daa5cd9c86a1167588c485ba7fb23940c38a392f622503da44fbcfeb747c20c

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

module Gemgento
  class Magento::OrderStatusAdapter

    attr_accessor :source, :order

    # @param source [Hash]
    # @param order [Gemgento::Order]
    def initialize(source, order)
      @source = source
      @order = order
    end
    
    def import
      order_status = Gemgento::OrderStatus.find_or_initialize_by(order_id: self.order.id, status: self.source[:status], comment: self.source[:comment])
      order_status.is_active = self.source[:is_active]
      order_status.is_customer_notified = self.source[:is_customer_notified].to_i
      order_status.created_at = self.source[:created_at]
      order_status.save!

      order_status
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/adapters/gemgento/magento/order_status_adapter.rb