Sha256: eaff541d5a4796ab4abf2976573c33c45d39f9046c05fb7838b9b19499528eaf

Contents?: true

Size: 989 Bytes

Versions: 2

Compression:

Stored size: 989 Bytes

Contents

class AddWinkelstraatTaxons < ActiveRecord::Migration

  WOMEN_CATEGORIES = ["Accessoires", "Badmode", "Blazers & Gilets", "Blouses", "Broeken", "Jassen", "Jeans",
                      "Jumpsuits", "Jurken", "Lingerie", "Nachtmode", "Rokken", "Schoenen", "Sport", "Tassen", "Tops", "Truien & Vesten"]
  MEN_CATEGORIES = ["Accessoires", "Badmode", "Broeken", "Colberts & Gilets", "Jassen", "Jeans", "Ondergoed",
                    "Overhemden", "Schoenen", "Shirts", "Sport", "Truien", "Vesten"]
  KIDS_CATEGORIES = ["Jongens", "Meisjes"]

  def change
    taxonomy = Spree::Taxonomy.find_or_create_by(name: 'Winkelstraat Category')

    WOMEN_CATEGORIES.each do |taxon|
      Spree::Taxon.find_or_create_by(name: taxon, taxonomy: taxonomy)
    end

    MEN_CATEGORIES.each do |taxon|
      Spree::Taxon.find_or_create_by(name: taxon, taxonomy: taxonomy)
    end

    KIDS_CATEGORIES.each do |taxon|
      Spree::Taxon.find_or_create_by(name: taxon, taxonomy: taxonomy)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_winkelstraat-3.1.0.21 db/migrate/20190501101657_add_winkelstraat_taxons.rb
spree_winkelstraat-3.1.0.20 db/migrate/20190501101657_add_winkelstraat_taxons.rb