Sha256: 4c9f1c0d2c64a13468082d2aba09c8d3fbe11d070c9b1490219c0f10d2c56632
Contents?: true
Size: 675 Bytes
Versions: 67
Compression:
Stored size: 675 Bytes
Contents
Spree::Sample.load_sample('properties') prototypes = [ { name: 'Shirt', properties: ['Manufacturer', 'Brand', 'Model', 'Lenght', 'Made from', '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_presentation| property = Spree::Property.find_by!(presentation: property_presentation) prototype.properties << property unless prototype.properties.include?(property) end end
Version data entries
67 entries across 67 versions & 1 rubygems