Sha256: 8ec8854ec7fe80df45872db585195ac29a95a8d54f5e82302730a08d4e45e6b9
Contents?: true
Size: 892 Bytes
Versions: 62
Compression:
Stored size: 892 Bytes
Contents
module Workarea class Lint class InconsistentDetails < Lint def run Catalog::Product.all.each_by(100) do |product| all_options = product .variants .map { |v| v.details.keys } .flatten .uniq .sort product.variants.each do |variant| check_details(all_options, variant) end end end def check_details(all_options, variant) if variant.details.blank? warn("#{variant.product.id},#{variant.sku},missing details") else all_options.each do |option| if variant.details[option].blank? warn("#{variant.product.id},#{variant.sku},missing detail `#{option}`") end end end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems