diff --git a/README.md b/README.md index dac0345d..9e4a96bb 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ SolidusPaypalBraintree::Gateway.new( ``` ### Configure payment types -Your payment method can accept payments in three ways: through Paypal, through ApplePay, or with credit card details entered directly by the customer. By default all are disabled for all your site's stores. +Your payment method can accept payments in three ways: through Paypal, through ApplePay, or with credit card details entered directly by the customer. By default all are disabled for all your site's stores. Before proceeding to checkout, ensure you've created a Braintree configuration for your store: 1. Visit /solidus_paypal_braintree/configurations/list diff --git a/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb b/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb index 1ba74818..51307a8b 100644 --- a/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb +++ b/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb @@ -1,9 +1,7 @@ class AddBraintreeConfigurationToStores < SolidusSupport::Migration[4.2] - def up - Spree::Store.all.each(&:create_braintree_configuration) - end - - def down - SolidusPaypalBraintree::Configuration.joins(:store).destroy_all - end +# The content of this migration has been removed because store's Braintree +# configuration doesn't already have paypal_button_preferences fields, so +# their validations will break this migration. +# +# Ref here for more info https://github.com/solidusio/solidus_paypal_braintree/pull/249 end diff --git a/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb b/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb index 07c68210..ac52ea6e 100644 --- a/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb +++ b/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb @@ -5,7 +5,7 @@ class ConfigurationsController < ::Spree::Admin::BaseController def list authorize! :list, SolidusPaypalBraintree::Configuration - @configurations = ::Spree::Store.all.map(&:braintree_configuration) + @configurations = ::Spree::Store.all.map { |s| s.braintree_configuration || s.create_braintree_configuration } end def update