Created
September 2, 2012 15:42
-
-
Save syndicut/3600683 to your computer and use it in GitHub Desktop.
Remove variants with duplicate sku's for spree commerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Variant.where({:is_master => false}).each { |v| Variant.where({:sku => v.sku}).where(['id != ?', v.id]).where({:is_master => false}).delete_all } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment