This file contains hidden or 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
| # Re-convert data | |
| ActiveRecord::Base.transaction do | |
| ProductSku.find_each do |product_sku| | |
| product_sku.product_sku_merchant_skus = [] | |
| old_merchant_skus = YAML.safe_load(product_sku.DEPRECATED_custom_codes || '') || [] | |
| clean_codes = old_merchant_skus.map(&:strip).reject(&:blank?).uniq | |
| clean_codes.each do |clean_code| | |
| ProductSkuMerchantSku.create!(:product_sku_id => product_sku.id, :sku_name => clean_code) |
This file contains hidden or 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
| Merchant SKU,Inventory,Restock Date,,,, | |
| HNY.500.20.023.050,999,2019-12-31,valid+valid+valid,,, | |
| HNY.500.10.028.095,888,2019-12-31,valid+valid+valid,,, | |
| HNY.300.30.052.930,777,2019-12-31,valid+valid+valid,,, | |
| HNY.500.70.044.100.MRBL,666,2019-12-31,valid+valid+valid,,, | |
| HNY.500.70.045.000.MRBL,555,2019-12-31,valid+valid+valid,,, | |
| HNY.500.70.046.000.MRBL,444,2019-12-31,valid+valid+valid,,, | |
| HNY.500.70.040.000.CPR,333,2019-12-31,valid+valid+valid,,, | |
| HNY.500.20.025.050,222,2019-12-31,valid+valid+valid,,, | |
| HNY.500.30.001.000,111,2019-12-31,valid+valid+valid,,, |
This file contains hidden or 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
| Merchant SKU,Inventory,Restock Date,Expectation, | |
| 1221623x,12,01-10-2019,skipped | |
| 1221618x,13,10-1-2019,skipped | |
| HNY.500.20.025.050,,,blank | |
| HNY.500.20.025.095,invalid,,error | |
| HNY.500.20.025.050,16,2019-12-01,OK | |
| HNY.500.20.025.095,17,2019-12-01,OK |
This file contains hidden or 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
| Merchant SKU,Inventory,Restock Date, | |
| HNY.500.20.023.050,876,2019-12-31, | |
| HNY.500.10.028.095,876,2019-12-31, | |
| HNY.300.30.052.930,876,2019-12-31, | |
| HNY.500.70.044.100.MRBL,876,2019-12-31, | |
| HNY.500.70.045.000.MRBL,876,2019-12-31, |
OlderNewer