Sha256: da8cc77b3a40686cb27ed6531e97b1407076189e2a63aa0d493608450251b374
Contents?: true
Size: 619 Bytes
Versions: 36
Compression:
Stored size: 619 Bytes
Contents
prototypes = [ { name: "Shirt", properties: ["Manufacturer", "Brand", "Model", "Shirt Type", "Sleeve Type", "Material", "Fit", "Gender"] }, { name: "Bag", properties: ["Type", "Size", "Material"] }, { name: "Mugs", properties: ["Size", "Type"] } ] prototypes.each do |prototype_attrs| prototype = Spree::Prototype.where(name: prototype_attrs[:name]).first_or_create! prototype_attrs[:properties].each do |property_name| property = Spree::Property.where(name: property_name).first prototype.properties << property unless prototype.properties.include?(property) end end
Version data entries
36 entries across 36 versions & 1 rubygems