Sha256: f53bd58145203579d46b511236f166d104c1270dd75194f1450b4b1d5a454c36
Contents?: true
Size: 826 Bytes
Versions: 15
Compression:
Stored size: 826 Bytes
Contents
class CreateSpreeStoreCreditPaymentMethod < ActiveRecord::Migration 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
15 entries across 15 versions & 1 rubygems