Sha256: 53d70da0735cb39b09f57164dda8e5707a744d97b29d45b2b74430656abf2fb3

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true
# This migration comes from spree_billing_sisow (originally 20150417081217)

class ChangeNameOfPaymentMethodTypes < ActiveRecord::Migration[5.0]
  def up
    name_maps.each do |old, new|
      Spree::PaymentMethod.where(type: old).update_all(type: new)
    end
  end

  def down
    name_maps.each do |old, new|
      Spree::PaymentMethod.where(type: new).update_all(type: old)
    end
  end

  private
  def name_maps
    {
     'Spree::BillingIntegration::SisowBilling::Ideal' => 'Spree::PaymentMethod::SisowBilling::Ideal',
     'Spree::BillingIntegration::SisowBilling::Bancontact' => 'Spree::PaymentMethod::SisowBilling::Bancontact',
     'Spree::BillingIntegration::SisowBilling::Sofort' => 'Spree::PaymentMethod::SisowBilling::Sofort'
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091925_change_name_of_payment_method_types.spree_billing_sisow.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091925_change_name_of_payment_method_types.spree_billing_sisow.rb