lib/loaders/spree/product_loader.rb
# Options:
#   [:dummy]           : Perform a dummy run - attempt to load everything but then roll back
#
[:dummy]           : Perform a dummy run - attempt to load everything but then roll back
[ : dummy ] : Perform a dummy run - attempt to load everything but then roll back
def perform_load( file_name, opts = {} )
        logger.info "Product load from File [#{file_name}]"
        options = opts.dup
        @we_can_process_these_anyway =  ["variant_price", "variant_sku","translation","taxons_ru","taxons", "price_ru","price_eu","stock",'images','meta_description','meta_keywords']
        @we_can_process_these_anyway << 'price' if(DataShift::SpreeHelper::version.to_f >= 1.3 )
        if(DataShift::SpreeHelper::version.to_f > 1 )
          options[:force_inclusion] = options[:force_inclusion] ? ([ *options[:force_inclusion]] + @we_can_process_these_anyway) : @we_can_process_these_anyway
        end
        logger.info "Product load using forced operators: [#{options[:force_inclusion]}]" if(options[:force_inclusion])
        super(file_name, options)
      end
def perform_load ( file_name , opts = { } ) logger . info "Product load from File [#{file_name}]" options = opts . dup @we_can_process_these_anyway = [ "variant_price" , "variant_sku" , "translation" , "taxons_ru" , "taxons" , "price_ru" , "price_eu" , "stock" , 'images' , 'meta_description' , 'meta_keywords' ] @we_can_process_these_anyway << 'price' if ( DataShift :: SpreeHelper :: version . to_f >= 1.3 ) if ( DataShift :: SpreeHelper :: version . to_f > 1 ) options [ :force_inclusion ] = options [ :force_inclusion ] ? ( [ * options [ :force_inclusion ] ] + @we_can_process_these_anyway ) : @we_can_process_these_anyway end logger . info "Product load using forced operators: [#{options[:force_inclusion]}]" if ( options [ :force_inclusion ] ) super ( file_name , options ) end
Options:
[:dummy]           : Perform a dummy run - attempt to load everything but then roll back
Options : [ : dummy ] : Perform a dummy run - attempt to load everything but then roll back
#puts "Product Loader -  Load Options", options.inspect # In >= 1.1.0 Image moved to master Variant from Product so no association called Images on Product anymore # Non Product/database fields we can still  process # In >= 1.3.0 price moved to master Variant from Product so no association called Price on Product anymore # taking care of it here, means users can still simply just include a price column
file_name
opts