Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #249 from nebulab/mm/i244-fix-migration
Browse files Browse the repository at this point in the history
Remove AddBraintreeConfigurationToStores migration
  • Loading branch information
kennyadsl authored Oct 15, 2020
2 parents b8bef75 + 0c03701 commit 6686af6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6686af6

Please sign in to comment.