Class: Spree::Seeds::PaymentMethods

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree/seeds/payment_methods.rb

Instance Method Summary collapse

Methods included from Spree::ServiceModule::Base

prepended

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
# File 'app/services/spree/seeds/payment_methods.rb', line 6

def call
  payment_method = Spree::PaymentMethod::StoreCredit.find_or_initialize_by(
    name: Spree.t(:store_credit_name),
    description: Spree.t(:store_credit_name),
    active: true
  )

  payment_method.stores = Spree::Store.all if payment_method.new_record?
  payment_method.save!
end