Sha256: 685fe7806b7906fe71d8f4d8128112627f5649e088020b2f86368042f748959d

Contents?: true

Size: 387 Bytes

Versions: 19

Compression:

Stored size: 387 Bytes

Contents

class SpreeStoreCreditTypes < ActiveRecord::Migration
  def up
    Spree::StoreCreditType.find_or_create_by(name: 'Expiring', priority: 1)
    Spree::StoreCreditType.find_or_create_by(name: 'Non-expiring', priority: 2)
  end

  def down
    Spree::StoreCreditType.find_by(name: 'Expiring').try(&:destroy)
    Spree::StoreCreditType.find_by(name: 'Non-expiring').try(&:destroy)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
spree_core-3.1.14 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.13 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.12 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.11 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.10 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.9 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.8 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.7 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.6 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.5 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.4 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.3 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.2 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.1 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.0 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.0.rc4 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.0.rc3 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.0.rc2 db/migrate/20150727191614_spree_store_credit_types.rb
spree_core-3.1.0.rc1 db/migrate/20150727191614_spree_store_credit_types.rb