From 9644fcf67cf3134c9777da2a303049d115c18bd3 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 6 Mar 2019 10:01:17 +0000 Subject: [PATCH] Improve payment method factory in sample data by removing constantize --- lib/tasks/sample_data/payment_method_factory.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/sample_data/payment_method_factory.rb b/lib/tasks/sample_data/payment_method_factory.rb index 640faf2c9c..2b3899a662 100644 --- a/lib/tasks/sample_data/payment_method_factory.rb +++ b/lib/tasks/sample_data/payment_method_factory.rb @@ -24,7 +24,7 @@ class PaymentMethodFactory def create_cash_method(enterprise) create_payment_method( - "Spree::PaymentMethod::Check", + Spree::PaymentMethod::Check, enterprise, "Cash on collection", "Pay on collection!", @@ -34,7 +34,7 @@ class PaymentMethodFactory def create_card_method(enterprise) create_payment_method( - "Spree::Gateway::Bogus", + Spree::Gateway::Bogus, enterprise, "Credit card (fake)", "We charge 1%, but won't ask for your details. ;-)", @@ -43,7 +43,7 @@ class PaymentMethodFactory end def create_payment_method(provider_class, enterprise, name, description, calculator) - payment_method = provider_class.constantize.new( + payment_method = provider_class.new( name: name, description: description, environment: Rails.env,