Sha256: f93613b289390b4938a0b77dc479c8a4ef1f2345a4592df252eb004d49e27851

Contents?: true

Size: 483 Bytes

Versions: 4

Compression:

Stored size: 483 Bytes

Contents

module Comable
  class Stock < ActiveRecord::Base
    module Csvable
      extend ActiveSupport::Concern

      include Comable::Importable

      included do
        comma do
          product_id
          id
          quantity
          sku_h_choice_name
          sku_v_choice_name
        end
      end

      delegate :id, to: :product, prefix: true, allow_nil: true

      def product_id=(id)
        self.product = Comable::Product.find_by(id: id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
comable-core-0.7.1 app/models/comable/stock/csvable.rb
comable-core-0.7.0 app/models/comable/stock/csvable.rb
comable-core-0.7.0.beta2 app/models/comable/stock/csvable.rb
comable-core-0.7.0.beta1 app/models/comable/stock/csvable.rb