Sha256: d8b9aee5fdd21f0d6ad4e20b6615c136a9a0cbd346f26439b06aa8d3e21c068d

Contents?: true

Size: 607 Bytes

Versions: 2

Compression:

Stored size: 607 Bytes

Contents

class AddWinkelstraatPaymentMethodAndShippingMethod < ActiveRecord::Migration
  def change
    Spree::PaymentMethod.find_or_create_by(name: 'Paid at winkelstraat', display_on: :back_end, type: 'Spree::PaymentMethod::Check', active: true)

    sm = Spree::ShippingMethod.find_or_create_by(name: 'Shipped by winkelstraat', display_on: :back_end, admin_name: 'Winkelstraat shipping')
    sm.zones = Spree::Zone.all
    sm.shipping_categories = [Spree::ShippingCategory.first]
    sm.calculator = Spree::Calculator::Shipping::FlatRate.create(calculable: sm) unless sm.calculator.present?
    sm.save!
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_winkelstraat-3.1.0.21 db/migrate/20190501122837_add_winkelstraat_payment_method_and_shipping_method.rb
spree_winkelstraat-3.1.0.20 db/migrate/20190501122837_add_winkelstraat_payment_method_and_shipping_method.rb