datashift_spree icon indicating copy to clipboard operation
datashift_spree copied to clipboard

Question: Is it possible to create/update existing variants and products?

Open davidtingsu opened this issue 11 years ago • 0 comments

My use case is to import a spreadsheet with products and their master variants (also which variant becomes master), updating any existing records in the database.

Update I've been getting this error but figured out this is because one of my column headers is empty.

*** NoMethodError Exception: undefined method `operator' for nil:NilClass
(rdb:1) puts e.backtrace.join("\n")
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/loader_base.rb:288:in `prepare_data'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:7in `each_with_index'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:74:in `block (2 levels) in perform_csv_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:55:in `each'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:55:in `each_with_index'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:55:in `block in perform_csv_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/activerecord-3.2.13/lib/active_record/transactions.rb:208:in `transaction'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/csv_loader.rb:52:in `perform_csv_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift-0.13.0/lib/loaders/loader_base.rb:118:in `perform_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift_spree-0.5.0/lib/loaders/spree/spree_base_loader.rb:49:in `perform_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift_spree-0.5.0/lib/loaders/spree/product_loader.rb:46:in `perform_load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/datashift_spree-0.5.0/lib/thor/spree/products_images.thor:65:in `products'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/runner.rb:36:in `method_missing'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/command.rb:29:in `run'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/command.rb:128:in `run'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/gems/thor-0.18.1/bin/thor:6:in `<top (required)>'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/bin/thor:19:in `load'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/bin/thor:19:in `<main>'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/bin/ruby_noexec_wrapper:14:in `eval'
/Users/<user>/.rvm/gems/ruby-1.9.3-p429@<namespace>/bin/ruby_noexec_wrapper:14:in `<main>'
nil'

davidtingsu avatar Jun 11 '13 16:06 davidtingsu