Sha256: 04590cb5c88b9c757015640646f5db4c4863f387abba765e71a40d45c0c0b6ad

Contents?: true

Size: 379 Bytes

Versions: 15

Compression:

Stored size: 379 Bytes

Contents

option_types_attributes = [
  {
    name: 'color',
    presentation: 'Color',
    position: 1
  },
  {
    name: 'length',
    presentation: 'Length',
    position: 2
  },
  {
    name: 'size',
    presentation: 'Size',
    position: 3
  },
]

option_types_attributes.each do |attrs|
  unless Spree::OptionType.where(attrs).exists?
    Spree::OptionType.create!(attrs)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spree_sample-4.10.1 db/samples/option_types.rb
spree_sample-4.10.0 db/samples/option_types.rb
spree_sample-4.9.0 db/samples/option_types.rb
spree_sample-4.8.3 db/samples/option_types.rb
spree_sample-4.8.2 db/samples/option_types.rb
spree_sample-4.7.3 db/samples/option_types.rb
spree_sample-4.6.6 db/samples/option_types.rb
spree_sample-4.6.5 db/samples/option_types.rb
spree_sample-4.7.1 db/samples/option_types.rb
spree_sample-4.6.4 db/samples/option_types.rb
spree_sample-4.7.0 db/samples/option_types.rb
spree_sample-4.6.3 db/samples/option_types.rb
spree_sample-4.6.2 db/samples/option_types.rb
spree_sample-4.6.1 db/samples/option_types.rb
spree_sample-4.6.0 db/samples/option_types.rb