Skip to content

Commit

Permalink
Merge pull request #80 from upsidelab/fix/unable_to_duplicate_product…
Browse files Browse the repository at this point in the history
…_with_translations

Fix generated slugs being overwritten by globalize stash
  • Loading branch information
damianlegawiec authored Nov 10, 2020
2 parents c7e9e5f + 98d0661 commit af1aa0b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/spree/product_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def property(property_name)
private

def duplicate_translations(old_product)
globalize.reset # Stash contains copied slugs of the product that's being duplicated
old_product.translations.each do |translation|
translation.slug = nil # slug must be regenerated
self.translations << translation.dup
Expand Down

0 comments on commit af1aa0b

Please sign in to comment.