-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport SolidusPaypalBraintree rename and earlier changes to v1.x #128
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Express Checkout support
* Add Solidus v2.8 * Remove Solidus v2.3
FactoryBot v5.0 defaults `use_parent_strategy` to true, which builds (rather than create) associations, which was causing several specs to fail.
SQLite3 v1.4 was released on February 4th, which breaks compatibility with ActiveRecord's adapter for said DB engine.
Extension maintenance
Add byebug as a development dependency for debugging during development and testing.
Add association on the spree user model to associate it with the braintree customer model.
Add byebug dependency
This moves the solidus dependency imports to only directly import solidus_core and solidus_api through the gemspec.
Simplify Solidus Dependencies
Closes #222. It adds an `id` local variable to `spree/shared/apple_pay_button` partial rendering in order to give such partial access to the payment method id.
Closes #224. On default Braintree configuration building we need to check whether a configuration already exists, so the prevent the overwrite of such configuration.
Fix undefined local variable or method `id' error
…onfiguration-presence-on-store-creation Skip building default config on config presence
Update italian translations
…ustomer Add association from user to customer
Make it match the defaults coming from dev-support.
Also normalizes a few things to better match the defaults coming from dev-support.
Update to the latest dev-support defaults
…solidus-paypal-braintree
…al-braintree Merge the history of Solidus PayPal Braintree into this repository
Using model classes local to the migration is a technique that allows accessing the underlying tables through AR without a dependency of the app models being available across time. This is supported by rails that explicitly sets the table_name_prefix of migration classes to be an empty string. In this specific case, for example, `SpreePayment.table_name` will be `spree_payments`, which is the same as `Spree::Payment.table_name`. If Spree::Payment will change name and become, say, Solidus::Payment, this migration won't break a sweat and will keep working. This way any change in table names or prefixes, or even removing a model altogether won't affect older migrations.
…migrations Make migrations independent of existing models
… braintree Do not include migration files. If renamed, `bin/rails railties:install:migrations` would interpret the migrations as new migrations for SolidusBraintree.
* Exclude CHANGELOG. * Exclude DB migration classes since they have to match their file names.
Exclude CHANGELOG and database table names.
Can be used by passing `require: 'solidus_paypal_braintree` directive to `gem 'solidus_braintree'` in Gemfile.
Fixes the following offenses: ``` solidus_braintree 17:53:08 $ bundle exec rubocop lib/generators/solidus_braintree/install/install_generator.rb Inspecting 1 file C Offenses: lib/generators/solidus_braintree/install/install_generator.rb:19:121: C: [Correctable] Layout/LineLength: Line is too long. [157/120] inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_braintree\n", before: %r{\*/}, verbose: true ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/generators/solidus_braintree/install/install_generator.rb:20:121: C: [Correctable] Layout/LineLength: Line is too long. [155/120] inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/solidus_braintree\n", before: %r{\*/}, verbose: true ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/generators/solidus_braintree/install/install_generator.rb:32:121: C: [Correctable] Layout/LineLength: Line is too long. [137/120] run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) ^^^^^^^^^^^^^^^^^ 1 file inspected, 3 offenses detected, 3 offenses autocorrectable ```
* Renames engine route and asset file paths. * Adds migration to update records referring to SolidusPaypalBraintree.
…on-namespace-to-solidus-braintree Update the SolidusPaypalBraintree namespace to SolidusBraintree
Offenses: app/models/solidus_braintree/transaction.rb:20:21: C: [Correctable] Style/InverseMethods: Use invalid? instead of inverting valid?. if address && !address.valid? ^^^^^^^^^^^^^^^ app/models/solidus_braintree/transaction_import.rb:12:57: C: [Correctable] Style/InverseMethods: Use invalid? instead of inverting valid?. errors.add("Address", "is invalid") if address && !address.valid? ^^^^^^^^^^^^^^^ app/models/solidus_braintree/transaction_import.rb:14:10: C: [Correctable] Style/InverseMethods: Use invalid? instead of inverting valid?. if !transaction.valid? ^^^^^^^^^^^^^^^^^^^
Offenses: app/models/solidus_braintree/transaction.rb:20:10: C: [Correctable] Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method. if address && address.invalid? ^^^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/solidus_braintree/transaction_import.rb:12:46: C: [Correctable] Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method. errors.add("Address", "is invalid") if address && address.invalid? ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Closing. As discussed offline, we don't want to include the name change in the 1.x line of the extension since it's a major breaking change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #127.
This PR would fast-forward https://github.com/solidusio/solidus_braintree/tree/v1.x up to and before #102. (To fix the CI, I cherry-picked the RuboCop offense fixes cb82bfe and 838c025.)
This is in preparation for releasing the last 1.x version for SolidusBraintree: v1.3.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: