Sha256: e20663046316ede6e5b0294b6e3c25725d8c43098649295ff9d883fb5eb0f402
Contents?: true
Size: 834 Bytes
Versions: 21
Compression:
Stored size: 834 Bytes
Contents
class CreateSpreeStoreCreditPaymentMethod < ActiveRecord::Migration[4.2] class PaymentMethod < Spree::Base self.table_name = 'spree_payment_methods' self.inheritance_column = :_type_disabled end def up # If migrating from Spree 3.0, the environment column is already gone. # We remove it in a later migration if upgrading from spree <= 2.4 to soldius if column_exists?(:spree_payment_methods, :environment) attributes = { type: "Spree::PaymentMethod::StoreCredit", environment: Rails.env } else attributes = { type: "Spree::PaymentMethod::StoreCredit" } end PaymentMethod.create_with( name: Spree.t("store_credit.store_credit"), description: Spree.t("store_credit.store_credit"), active: true, display_on: 'none' ).find_or_create_by!(attributes) end end
Version data entries
21 entries across 21 versions & 1 rubygems