spree_core 4.2.0.rc2 → 4.2.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/base_controller.rb +0 -2
  3. data/app/finders/spree/addresses/find.rb +1 -12
  4. data/app/finders/spree/base_finder.rb +14 -0
  5. data/app/finders/spree/countries/find.rb +11 -3
  6. data/app/finders/spree/credit_cards/find.rb +2 -2
  7. data/app/finders/spree/orders/find_current.rb +1 -1
  8. data/app/helpers/spree/base_helper.rb +1 -7
  9. data/app/mailers/spree/base_mailer.rb +4 -4
  10. data/app/mailers/spree/order_mailer.rb +3 -3
  11. data/app/mailers/spree/reimbursement_mailer.rb +1 -1
  12. data/app/mailers/spree/shipment_mailer.rb +1 -1
  13. data/app/models/concerns/spree/default_price.rb +1 -5
  14. data/app/models/concerns/spree/user_methods.rb +2 -2
  15. data/app/models/spree/ability.rb +2 -6
  16. data/app/models/spree/address.rb +4 -0
  17. data/app/models/spree/app_dependencies.rb +4 -2
  18. data/app/models/spree/base.rb +5 -0
  19. data/app/models/spree/fulfilment_changer.rb +58 -16
  20. data/app/models/spree/inventory_unit.rb +2 -7
  21. data/app/models/spree/line_item.rb +1 -6
  22. data/app/models/spree/order.rb +1 -0
  23. data/app/models/spree/payment.rb +18 -4
  24. data/app/models/spree/payment/processing.rb +2 -2
  25. data/app/models/spree/payment_method.rb +3 -3
  26. data/app/models/spree/price.rb +1 -6
  27. data/app/models/spree/product.rb +12 -2
  28. data/app/models/spree/promotion/rules/product.rb +2 -1
  29. data/app/models/spree/promotion/rules/user.rb +2 -1
  30. data/app/models/spree/refund.rb +2 -2
  31. data/app/models/spree/return_item/eligibility_validator/default.rb +0 -2
  32. data/app/models/spree/return_item/eligibility_validator/{r_m_a_required.rb → rma_required.rb} +0 -0
  33. data/app/models/spree/shipment.rb +1 -1
  34. data/app/models/spree/shipping_method.rb +1 -5
  35. data/app/models/spree/shipping_rate.rb +2 -11
  36. data/app/models/spree/stock/availability_validator.rb +3 -4
  37. data/app/models/spree/stock_item.rb +1 -5
  38. data/app/models/spree/store.rb +24 -0
  39. data/app/models/spree/store_credit.rb +1 -1
  40. data/app/models/spree/variant.rb +1 -8
  41. data/app/models/spree/zone.rb +13 -4
  42. data/app/services/spree/account/addresses/create.rb +6 -1
  43. data/app/services/spree/account/addresses/{base.rb → helper.rb} +1 -3
  44. data/app/services/spree/account/addresses/update.rb +6 -1
  45. data/app/services/spree/compare_line_items.rb +4 -2
  46. data/app/sorters/spree/base_sorter.rb +35 -0
  47. data/app/sorters/spree/orders/sort.rb +1 -37
  48. data/app/sorters/spree/products/sort.rb +9 -32
  49. data/app/validators/email_validator.rb +1 -1
  50. data/config/initializers/inflections.rb +3 -0
  51. data/config/initializers/rails61_fixes.rb +3 -0
  52. data/config/locales/en.yml +25 -8
  53. data/db/migrate/20130326175857_add_stock_location_to_rma.rb +1 -1
  54. data/db/migrate/20201127084048_add_default_country_kind_to_spree_zones.rb +5 -0
  55. data/db/migrate/20210112193440_remove_contact_email_from_spree_stores.rb +5 -0
  56. data/db/migrate/20210114182625_create_spree_payment_methods_stores.rb +10 -0
  57. data/db/migrate/20210114220232_migrate_data_payment_methods_stores.rb +15 -0
  58. data/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb +5 -0
  59. data/lib/spree/core/product_filters.rb +3 -3
  60. data/lib/spree/core/version.rb +1 -1
  61. data/lib/spree/i18n.rb +7 -21
  62. data/lib/spree/permitted_attributes.rb +2 -2
  63. data/lib/spree/service_module.rb +6 -2
  64. data/lib/spree/testing_support/capybara_config.rb +1 -1
  65. data/lib/spree/testing_support/factories/shipment_factory.rb +7 -9
  66. data/lib/spree/testing_support/factories/zone_factory.rb +16 -13
  67. data/lib/spree/testing_support/order_walkthrough.rb +8 -3
  68. data/lib/spree/testing_support/rspec_retry_config.rb +10 -0
  69. data/spree_core.gemspec +4 -3
  70. metadata +55 -21
  71. data/lib/spree/i18n/base.rb +0 -17
  72. data/lib/spree/i18n/initializer.rb +0 -1
@@ -1,11 +1,16 @@
1
1
  class OrderWalkthrough
2
2
  def self.up_to(state)
3
- # A default store must exist to provide store settings
4
- store = Spree::Store.default || FactoryBot.create(:store, default: true)
3
+ store = if Spree::Store.exists?
4
+ # Ensure the default store is used
5
+ Spree::Store.default || FactoryBot.create(:store, default: true)
6
+ else
7
+ # Create a default store
8
+ FactoryBot.create(:store, default: true)
9
+ end
5
10
 
6
11
  # A payment method must exist for an order to proceed through the Address state
7
12
  unless Spree::PaymentMethod.exists?
8
- FactoryBot.create(:check_payment_method)
13
+ FactoryBot.create(:check_payment_method, stores: [store])
9
14
  end
10
15
 
11
16
  # Need to create a valid zone too...
@@ -0,0 +1,10 @@
1
+ require 'rspec/retry'
2
+
3
+ RSpec.configure do |config|
4
+ config.verbose_retry = true
5
+ config.display_try_failure_messages = true
6
+
7
+ config.around :each, type: :feature do |ex|
8
+ ex.run_with_retry retry: ENV.fetch('RSPEC_RETRY_RETRY_COUNT', 3).to_i
9
+ end
10
+ end
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
 
29
29
  s.add_dependency 'activemerchant', '~> 1.67'
30
30
  s.add_dependency 'acts_as_list', '~> 0.8'
31
- s.add_dependency 'awesome_nested_set', '>= 3.1.4', '< 3.3.0'
31
+ s.add_dependency 'awesome_nested_set', '>= 3.3.1', '< 4.0'
32
32
  s.add_dependency 'carmen', '>= 1.0', '< 1.2'
33
33
  s.add_dependency 'cancancan', '~> 3.0'
34
34
  s.add_dependency 'ffaker', '~> 2.9'
@@ -39,9 +39,10 @@ Gem::Specification.new do |s|
39
39
  s.add_dependency 'monetize', '~> 1.9'
40
40
  s.add_dependency 'paranoia', '~> 2.4.2'
41
41
  s.add_dependency 'premailer-rails'
42
- s.add_dependency 'rails', '~> 6.0.0'
43
- s.add_dependency 'ransack', '~> 2.3.0'
42
+ s.add_dependency 'rails', '>= 6.0', '< 6.2'
43
+ s.add_dependency 'ransack', '>= 2.3', '< 2.5'
44
44
  s.add_dependency 'responders'
45
+ s.add_dependency 'rexml'
45
46
  s.add_dependency 'state_machines-activerecord', '~> 0.6'
46
47
  s.add_dependency 'state_machines-activemodel', '~> 0.7'
47
48
  s.add_dependency 'stringex'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0.rc2
4
+ version: 4.2.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-10 00:00:00.000000000 Z
12
+ date: 2021-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemerchant
@@ -45,20 +45,20 @@ dependencies:
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 3.1.4
48
+ version: 3.3.1
49
49
  - - "<"
50
50
  - !ruby/object:Gem::Version
51
- version: 3.3.0
51
+ version: '4.0'
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: 3.1.4
58
+ version: 3.3.1
59
59
  - - "<"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.3.0
61
+ version: '4.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: carmen
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -215,30 +215,42 @@ dependencies:
215
215
  name: rails
216
216
  requirement: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - "~>"
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '6.0'
221
+ - - "<"
219
222
  - !ruby/object:Gem::Version
220
- version: 6.0.0
223
+ version: '6.2'
221
224
  type: :runtime
222
225
  prerelease: false
223
226
  version_requirements: !ruby/object:Gem::Requirement
224
227
  requirements:
225
- - - "~>"
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '6.0'
231
+ - - "<"
226
232
  - !ruby/object:Gem::Version
227
- version: 6.0.0
233
+ version: '6.2'
228
234
  - !ruby/object:Gem::Dependency
229
235
  name: ransack
230
236
  requirement: !ruby/object:Gem::Requirement
231
237
  requirements:
232
- - - "~>"
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ version: '2.3'
241
+ - - "<"
233
242
  - !ruby/object:Gem::Version
234
- version: 2.3.0
243
+ version: '2.5'
235
244
  type: :runtime
236
245
  prerelease: false
237
246
  version_requirements: !ruby/object:Gem::Requirement
238
247
  requirements:
239
- - - "~>"
248
+ - - ">="
240
249
  - !ruby/object:Gem::Version
241
- version: 2.3.0
250
+ version: '2.3'
251
+ - - "<"
252
+ - !ruby/object:Gem::Version
253
+ version: '2.5'
242
254
  - !ruby/object:Gem::Dependency
243
255
  name: responders
244
256
  requirement: !ruby/object:Gem::Requirement
@@ -253,6 +265,20 @@ dependencies:
253
265
  - - ">="
254
266
  - !ruby/object:Gem::Version
255
267
  version: '0'
268
+ - !ruby/object:Gem::Dependency
269
+ name: rexml
270
+ requirement: !ruby/object:Gem::Requirement
271
+ requirements:
272
+ - - ">="
273
+ - !ruby/object:Gem::Version
274
+ version: '0'
275
+ type: :runtime
276
+ prerelease: false
277
+ version_requirements: !ruby/object:Gem::Requirement
278
+ requirements:
279
+ - - ">="
280
+ - !ruby/object:Gem::Version
281
+ version: '0'
256
282
  - !ruby/object:Gem::Dependency
257
283
  name: state_machines-activerecord
258
284
  requirement: !ruby/object:Gem::Requirement
@@ -422,6 +448,7 @@ files:
422
448
  - app/assets/javascripts/spree.js
423
449
  - app/controllers/spree/base_controller.rb
424
450
  - app/finders/spree/addresses/find.rb
451
+ - app/finders/spree/base_finder.rb
425
452
  - app/finders/spree/countries/find.rb
426
453
  - app/finders/spree/credit_cards/find.rb
427
454
  - app/finders/spree/line_items/find_by_variant.rb
@@ -579,7 +606,7 @@ files:
579
606
  - app/models/spree/return_item/eligibility_validator/inventory_shipped.rb
580
607
  - app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
581
608
  - app/models/spree/return_item/eligibility_validator/order_completed.rb
582
- - app/models/spree/return_item/eligibility_validator/r_m_a_required.rb
609
+ - app/models/spree/return_item/eligibility_validator/rma_required.rb
583
610
  - app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
584
611
  - app/models/spree/return_item/exchange_variant_eligibility/same_option_value.rb
585
612
  - app/models/spree/return_item/exchange_variant_eligibility/same_product.rb
@@ -635,8 +662,8 @@ files:
635
662
  - app/presenters/spree/variant_presenter.rb
636
663
  - app/presenters/spree/variants/option_types_presenter.rb
637
664
  - app/presenters/spree/variants/options_presenter.rb
638
- - app/services/spree/account/addresses/base.rb
639
665
  - app/services/spree/account/addresses/create.rb
666
+ - app/services/spree/account/addresses/helper.rb
640
667
  - app/services/spree/account/addresses/update.rb
641
668
  - app/services/spree/cart/add_item.rb
642
669
  - app/services/spree/cart/create.rb
@@ -655,6 +682,7 @@ files:
655
682
  - app/services/spree/checkout/update.rb
656
683
  - app/services/spree/compare_line_items.rb
657
684
  - app/services/spree/generate_token.rb
685
+ - app/sorters/spree/base_sorter.rb
658
686
  - app/sorters/spree/orders/sort.rb
659
687
  - app/sorters/spree/products/sort.rb
660
688
  - app/validators/db_maximum_length_validator.rb
@@ -686,8 +714,10 @@ files:
686
714
  - config/initializers/active_storage.rb
687
715
  - config/initializers/assets.rb
688
716
  - config/initializers/friendly_id.rb
717
+ - config/initializers/inflections.rb
689
718
  - config/initializers/premailer_assets.rb
690
719
  - config/initializers/premailer_rails.rb
720
+ - config/initializers/rails61_fixes.rb
691
721
  - config/initializers/state_machine.rb
692
722
  - config/locales/en.yml
693
723
  - config/routes.rb
@@ -979,6 +1009,11 @@ files:
979
1009
  - db/migrate/20201006110150_add_checkout_zone_field_to_store.rb
980
1010
  - db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb
981
1011
  - db/migrate/20201013084504_add_seo_robots_to_spree_stores.rb
1012
+ - db/migrate/20201127084048_add_default_country_kind_to_spree_zones.rb
1013
+ - db/migrate/20210112193440_remove_contact_email_from_spree_stores.rb
1014
+ - db/migrate/20210114182625_create_spree_payment_methods_stores.rb
1015
+ - db/migrate/20210114220232_migrate_data_payment_methods_stores.rb
1016
+ - db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb
982
1017
  - db/seeds.rb
983
1018
  - lib/friendly_id/slug_rails5_patch.rb
984
1019
  - lib/generators/spree/custom_user/custom_user_generator.rb
@@ -1038,8 +1073,6 @@ files:
1038
1073
  - lib/spree/database_type_utilities.rb
1039
1074
  - lib/spree/dependencies_helper.rb
1040
1075
  - lib/spree/i18n.rb
1041
- - lib/spree/i18n/base.rb
1042
- - lib/spree/i18n/initializer.rb
1043
1076
  - lib/spree/localized_number.rb
1044
1077
  - lib/spree/migrations.rb
1045
1078
  - lib/spree/money.rb
@@ -1111,6 +1144,7 @@ files:
1111
1144
  - lib/spree/testing_support/kernel.rb
1112
1145
  - lib/spree/testing_support/order_walkthrough.rb
1113
1146
  - lib/spree/testing_support/preferences.rb
1147
+ - lib/spree/testing_support/rspec_retry_config.rb
1114
1148
  - lib/spree/testing_support/url_helpers.rb
1115
1149
  - lib/spree_core.rb
1116
1150
  - lib/tasks/core.rake
@@ -1130,9 +1164,9 @@ licenses:
1130
1164
  - BSD-3-Clause
1131
1165
  metadata:
1132
1166
  bug_tracker_uri: https://github.com/spree/spree/issues
1133
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.0.rc2
1167
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.0.rc3
1134
1168
  documentation_uri: https://guides.spreecommerce.org/
1135
- source_code_uri: https://github.com/spree/spree/tree/v4.2.0.rc2
1169
+ source_code_uri: https://github.com/spree/spree/tree/v4.2.0.rc3
1136
1170
  post_install_message:
1137
1171
  rdoc_options: []
1138
1172
  require_paths:
@@ -1148,7 +1182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1148
1182
  - !ruby/object:Gem::Version
1149
1183
  version: 1.8.23
1150
1184
  requirements: []
1151
- rubygems_version: 3.1.2
1185
+ rubygems_version: 3.1.4
1152
1186
  signing_key:
1153
1187
  specification_version: 4
1154
1188
  summary: The bare bones necessary for Spree.
@@ -1,17 +0,0 @@
1
- module Spree
2
- module ViewContext
3
- def self.context=(context)
4
- @context = context
5
- end
6
-
7
- def self.context
8
- @context
9
- end
10
-
11
- def view_context
12
- super.tap do |context|
13
- Spree::ViewContext.context = context
14
- end
15
- end
16
- end
17
- end
@@ -1 +0,0 @@
1
- Spree::BaseController.include Spree::ViewContext