Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Add mysql2 for ci, and raise errors in product handler for failed cre…
Browse files Browse the repository at this point in the history
…ate calls.
  • Loading branch information
Jeff Dutil authored and Jeff Dutil committed Jan 8, 2015
1 parent 08a295b commit d61447d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gem 'spree', github: 'spree/spree', branch: "master"
gem 'coffee-rails', '~> 4.0.0'
gem 'sass-rails', '~> 4.0.0'

gem 'mysql2'
gem 'pg'

group :test do
Expand Down
6 changes: 3 additions & 3 deletions lib/spree/wombat/handler/product_handler_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ def add_taxon(parent, taxon_names, position = 0)
if taxon
parent.children << taxon
else
taxon = parent.children.create(name: taxon_name, position: position)
taxon = parent.children.create!(name: taxon_name, position: position)
end
parent.save
# store the taxon so we can assign it later
@taxon_ids << taxon.id
add_taxon(taxon, taxon_names, position+1)
add_taxon(taxon, taxon_names, position + 1)
end

def process_images(variant, images)
Expand Down Expand Up @@ -125,7 +125,7 @@ def process_child_products(product, children)
if variant
variant.update_attributes(child_product)
else
variant = product.variants.create({ product: product }.merge(child_product))
variant = product.variants.create!({ product: product }.merge(child_product))
end
process_images(variant, images)
end
Expand Down

0 comments on commit d61447d

Please sign in to comment.