Class: Spree::Seeds::PaymentMethods
- Inherits:
-
Object
- Object
- Spree::Seeds::PaymentMethods
- Includes:
- Spree::ServiceModule::Base
- Defined in:
- app/services/spree/seeds/payment_methods.rb
Instance Method Summary collapse
Methods included from Spree::ServiceModule::Base
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/services/spree/seeds/payment_methods.rb', line 6 def call Spree::Store.all.find_each do |store| payment_method = store.payment_methods.find_or_initialize_by( type: 'Spree::PaymentMethod::StoreCredit' ) next if payment_method.persisted? payment_method.name = Spree.t(:store_credit_name) payment_method.description = Spree.t(:store_credit_name) payment_method.active = true payment_method.save! end end |