spree_core 6.0.4 → 6.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/app/jobs/spree/imports/create_rows_job.rb +4 -2
  3. data/app/jobs/spree/imports/process_rows_job.rb +4 -2
  4. data/app/jobs/spree/products/auto_match_taxons_job.rb +5 -2
  5. data/app/jobs/spree/search_provider/index_job.rb +8 -0
  6. data/app/jobs/spree/search_provider/remove_job.rb +3 -0
  7. data/app/jobs/spree/stock_locations/stock_items/create_job.rb +5 -2
  8. data/app/mailers/spree/base_mailer.rb +1 -1
  9. data/app/models/concerns/spree/acted_by.rb +2 -2
  10. data/app/models/concerns/spree/customer_methods.rb +6 -4
  11. data/app/models/concerns/spree/deprecated_customer_alias.rb +11 -3
  12. data/app/models/concerns/spree/derived_number.rb +1 -1
  13. data/app/models/concerns/spree/has_custom_fields.rb +12 -10
  14. data/app/models/concerns/spree/integrations_concern.rb +5 -3
  15. data/app/models/concerns/spree/label_translatable.rb +4 -4
  16. data/app/models/concerns/spree/metadata.rb +3 -3
  17. data/app/models/concerns/spree/presentation_translatable.rb +1 -1
  18. data/app/models/concerns/spree/purchase/addresses.rb +8 -5
  19. data/app/models/concerns/spree/purchase/deprecated_aliases.rb +2 -2
  20. data/app/models/concerns/spree/stores/markets.rb +4 -2
  21. data/app/models/concerns/spree/user_address.rb +5 -2
  22. data/app/models/concerns/spree/user_methods.rb +2 -2
  23. data/app/models/spree/address.rb +29 -14
  24. data/app/models/spree/asset.rb +3 -3
  25. data/app/models/spree/base.rb +1 -1
  26. data/app/models/spree/calculator/shipping/flat_rate.rb +6 -4
  27. data/app/models/spree/cart.rb +2 -2
  28. data/app/models/spree/category.rb +8 -6
  29. data/app/models/spree/classification.rb +2 -2
  30. data/app/models/spree/current.rb +19 -0
  31. data/app/models/spree/custom_field.rb +6 -6
  32. data/app/models/spree/custom_field_definition.rb +10 -7
  33. data/app/models/spree/delivery_method.rb +21 -15
  34. data/app/models/spree/delivery_rate.rb +1 -1
  35. data/app/models/spree/digital.rb +1 -1
  36. data/app/models/spree/digital_asset.rb +2 -2
  37. data/app/models/spree/digital_link.rb +4 -4
  38. data/app/models/spree/export.rb +29 -2
  39. data/app/models/spree/fulfillment/custom_events.rb +18 -10
  40. data/app/models/spree/fulfillment.rb +30 -23
  41. data/app/models/spree/fulfillment_item.rb +3 -3
  42. data/app/models/spree/fulfilment_changer.rb +1 -1
  43. data/app/models/spree/gift_card.rb +12 -12
  44. data/app/models/spree/import.rb +23 -15
  45. data/app/models/spree/import_row.rb +6 -6
  46. data/app/models/spree/inventory_unit.rb +1 -1
  47. data/app/models/spree/invitation.rb +8 -4
  48. data/app/models/spree/line_item.rb +10 -8
  49. data/app/models/spree/media.rb +2 -2
  50. data/app/models/spree/metafield.rb +1 -1
  51. data/app/models/spree/metafield_definition.rb +1 -1
  52. data/app/models/spree/metafields.rb +2 -2
  53. data/app/models/spree/option_type.rb +26 -0
  54. data/app/models/spree/option_value.rb +3 -3
  55. data/app/models/spree/order.rb +87 -45
  56. data/app/models/spree/order_inventory.rb +2 -2
  57. data/app/models/spree/order_merger.rb +2 -2
  58. data/app/models/spree/order_updater.rb +34 -20
  59. data/app/models/spree/payment.rb +8 -8
  60. data/app/models/spree/payment_method.rb +11 -9
  61. data/app/models/spree/price.rb +19 -8
  62. data/app/models/spree/price_list.rb +12 -6
  63. data/app/models/spree/price_rules/zone_rule.rb +1 -1
  64. data/app/models/spree/product.rb +26 -24
  65. data/app/models/spree/product_category.rb +3 -3
  66. data/app/models/spree/promotion/rules/category.rb +27 -10
  67. data/app/models/spree/promotion/rules/country.rb +1 -1
  68. data/app/models/spree/promotion/rules/taxon.rb +4 -2
  69. data/app/models/spree/promotion/rules/user.rb +1 -1
  70. data/app/models/spree/promotion_action.rb +1 -1
  71. data/app/models/spree/promotion_rule_category.rb +5 -5
  72. data/app/models/spree/promotion_rule_taxon.rb +2 -2
  73. data/app/models/spree/prototype.rb +4 -1
  74. data/app/models/spree/return_authorization_reason.rb +3 -3
  75. data/app/models/spree/return_reason.rb +1 -1
  76. data/app/models/spree/search_provider/base.rb +2 -2
  77. data/app/models/spree/search_provider.rb +7 -5
  78. data/app/models/spree/shipment.rb +4 -1
  79. data/app/models/spree/shipping_method.rb +4 -1
  80. data/app/models/spree/shipping_rate.rb +1 -1
  81. data/app/models/spree/stock/coordinator.rb +2 -2
  82. data/app/models/spree/stock/estimator.rb +7 -5
  83. data/app/models/spree/stock/package.rb +10 -8
  84. data/app/models/spree/stock_item.rb +1 -1
  85. data/app/models/spree/stock_level/custom_events.rb +1 -1
  86. data/app/models/spree/stock_level.rb +1 -1
  87. data/app/models/spree/stock_location.rb +12 -8
  88. data/app/models/spree/stock_movement.rb +6 -6
  89. data/app/models/spree/stock_reservation.rb +5 -5
  90. data/app/models/spree/store.rb +42 -16
  91. data/app/models/spree/store_credit.rb +2 -2
  92. data/app/models/spree/store_credit_category.rb +5 -5
  93. data/app/models/spree/store_credit_type.rb +2 -2
  94. data/app/models/spree/subscriber.rb +7 -7
  95. data/app/models/spree/tax_rate.rb +5 -5
  96. data/app/models/spree/taxon.rb +3 -3
  97. data/app/models/spree/taxon_rule.rb +2 -2
  98. data/app/models/spree/taxonomy.rb +1 -1
  99. data/app/models/spree/variant.rb +12 -10
  100. data/app/models/spree/variant_media.rb +1 -1
  101. data/app/models/spree/wished_item.rb +1 -1
  102. data/app/models/spree/wishlist.rb +2 -2
  103. data/app/models/spree/wishlist_item/custom_events.rb +2 -2
  104. data/app/models/spree/zone.rb +1 -1
  105. data/app/models/spree/zone_member.rb +1 -1
  106. data/app/services/spree/carts/associate.rb +6 -2
  107. data/app/services/spree/carts/create.rb +1 -1
  108. data/app/services/spree/carts/destroy.rb +1 -1
  109. data/app/services/spree/carts/remove_item.rb +1 -1
  110. data/app/services/spree/carts/remove_line_item.rb +2 -2
  111. data/app/services/spree/carts/remove_out_of_stock_items.rb +3 -1
  112. data/app/services/spree/carts/set_quantity.rb +2 -2
  113. data/app/services/spree/carts/update.rb +17 -0
  114. data/app/services/spree/checkout/add_store_credit.rb +3 -3
  115. data/app/services/spree/checkout/remove_store_credit.rb +2 -2
  116. data/app/services/spree/imports/row_processors/product_variant.rb +19 -0
  117. data/app/services/spree/orders/approve.rb +3 -3
  118. data/app/services/spree/orders/create_user_account.rb +2 -2
  119. data/app/services/spree/products/auto_match_taxons.rb +5 -2
  120. data/app/services/spree/shipments/update.rb +2 -2
  121. data/app/services/spree/stock_locations/stock_items/create.rb +5 -2
  122. data/app/services/spree/stock_reservations/extend.rb +3 -1
  123. data/app/services/spree/stock_reservations/reserve.rb +3 -1
  124. data/app/services/spree/taxons/add_products.rb +4 -2
  125. data/app/services/spree/taxons/regenerate_products.rb +5 -2
  126. data/app/services/spree/taxons/remove_products.rb +4 -2
  127. data/app/workflows/spree/carts/add_item.rb +1 -1
  128. data/app/workflows/spree/carts/recalculate.rb +1 -1
  129. data/app/workflows/spree/fulfillments/update.rb +1 -1
  130. data/app/workflows/spree/orders/cancel.rb +3 -1
  131. data/app/workflows/spree/payments/capture.rb +2 -2
  132. data/app/workflows/spree/seller_transfers/create.rb +1 -1
  133. data/config/locales/en.yml +4 -0
  134. data/db/migrate/20260710000001_rename_taxons_to_categories.rb +1 -1
  135. data/db/migrate/20260728000004_rename_shipping_to_fulfillment_and_delivery.rb +1 -1
  136. data/db/migrate/20260806000001_add_store_id_to_spree_tax_rates_and_categories.rb +1 -1
  137. data/db/migrate/20260807130001_add_country_state_codes_to_consumers.rb +1 -1
  138. data/db/migrate/20260809000001_rename_metafields_to_custom_fields.rb +1 -1
  139. data/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb +1 -1
  140. data/db/migrate/20260811000001_add_delivery_tracking_to_fulfillments.rb +1 -1
  141. data/db/migrate/20260824000001_add_store_to_spree_media.rb +1 -1
  142. data/db/migrate/20260828100001_unify_import_and_export_tenancy.rb +1 -1
  143. data/db/migrate/20261016000001_remove_default_from_spree_tax_rates_included_in_price.rb +1 -1
  144. data/lib/spree/agent_tools/default_catalog.rb +2 -2
  145. data/lib/spree/agent_tools/legacy_tools.rb +1 -1
  146. data/lib/spree/core/dependencies.rb +10 -10
  147. data/lib/spree/core/engine.rb +4 -0
  148. data/lib/spree/core/number_generator.rb +4 -3
  149. data/lib/spree/core/preferences/preferable.rb +1 -1
  150. data/lib/spree/core/preferences/preferable_class_methods.rb +5 -1
  151. data/lib/spree/core/pricing/resolver.rb +2 -2
  152. data/lib/spree/core/version.rb +1 -1
  153. data/lib/spree/core.rb +37 -10
  154. data/lib/spree/i18n.rb +6 -2
  155. data/lib/spree/localized_number.rb +1 -1
  156. data/lib/spree/removed_apis.rb +274 -0
  157. data/lib/spree/reporting/default_vocabulary.rb +1 -1
  158. data/lib/spree/testing_support/factories/digital_asset_factory.rb +1 -1
  159. data/lib/spree/testing_support/factories/stock_level_factory.rb +1 -1
  160. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  161. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  162. data/lib/spree/testing_support/factories/wishlist_item_factory.rb +1 -1
  163. data/lib/spree/testing_support/i18n.rb +7 -2
  164. data/lib/spree/testing_support/order_walkthrough.rb +5 -2
  165. data/lib/spree/upgrades/5_6_to_6_0/manifest.yml +14 -14
  166. data/lib/tasks/carts_migration.rake +1 -1
  167. data/lib/tasks/categories_and_collections.rake +1 -1
  168. data/lib/tasks/deliveries_migration.rake +1 -1
  169. data/lib/tasks/delivery_method_rules_migration.rake +1 -1
  170. data/lib/tasks/delivery_migration.rake +1 -1
  171. data/lib/tasks/delivery_profiles_migration.rake +2 -2
  172. data/lib/tasks/fold_store_credit_categories.rake +1 -1
  173. data/lib/tasks/migrate_country_state_codes.rake +1 -1
  174. data/lib/tasks/migrate_returns.rake +4 -4
  175. data/lib/tasks/migrate_rich_text_to_columns.rake +1 -1
  176. data/lib/tasks/store_settings.rake +1 -1
  177. data/lib/tasks/typed_stock_movements_migration.rake +1 -1
  178. metadata +7 -6
@@ -137,27 +137,38 @@ module Spree
137
137
  alias_attribute :price, :amount
138
138
  alias_attribute :compare_at_price, :compare_at_amount
139
139
 
140
- # @deprecated Prices are charged as entered for every buyer since 6.0. Use {#price}; removed in 6.1.
140
+ # @deprecated Prices are charged as entered for every buyer since 6.0. Use {#price}; removed in 6.3.
141
141
  def price_including_vat_for(_price_options = {})
142
- Spree::Deprecation.warn('Spree::Price#price_including_vat_for is deprecated and will be removed in Spree 6.1. Prices are charged as entered; use #price instead.')
142
+ Spree::Deprecation.warn(
143
+ 'Spree::Price#price_including_vat_for is deprecated and will be removed in Spree 6.3. Prices are charged as entered; use #price instead.'
144
+ )
143
145
  price
144
146
  end
145
147
 
146
- # @deprecated Use {#compare_at_price}; removed in 6.1.
148
+ # @deprecated Use {#compare_at_price}; removed in 6.3.
147
149
  def compare_at_price_including_vat_for(_price_options = {})
148
- Spree::Deprecation.warn('Spree::Price#compare_at_price_including_vat_for is deprecated and will be removed in Spree 6.1. Prices are charged as entered; use #compare_at_price instead.')
150
+ Spree::Deprecation.warn(
151
+ 'Spree::Price#compare_at_price_including_vat_for is deprecated and will be removed in Spree 6.3. ' \
152
+ 'Prices are charged as entered; use #compare_at_price instead.'
153
+ )
149
154
  compare_at_price
150
155
  end
151
156
 
152
- # @deprecated Use {#display_price}; removed in 6.1.
157
+ # @deprecated Use {#display_price}; removed in 6.3.
153
158
  def display_price_including_vat_for(_price_options = {})
154
- Spree::Deprecation.warn('Spree::Price#display_price_including_vat_for is deprecated and will be removed in Spree 6.1. Prices are charged as entered; use #display_price instead.')
159
+ Spree::Deprecation.warn(
160
+ 'Spree::Price#display_price_including_vat_for is deprecated and will be removed in Spree 6.3. ' \
161
+ 'Prices are charged as entered; use #display_price instead.'
162
+ )
155
163
  display_price
156
164
  end
157
165
 
158
- # @deprecated Use {#display_compare_at_price}; removed in 6.1.
166
+ # @deprecated Use {#display_compare_at_price}; removed in 6.3.
159
167
  def display_compare_at_price_including_vat_for(_price_options = {})
160
- Spree::Deprecation.warn('Spree::Price#display_compare_at_price_including_vat_for is deprecated and will be removed in Spree 6.1. Prices are charged as entered; use #display_compare_at_price instead.')
168
+ Spree::Deprecation.warn(
169
+ 'Spree::Price#display_compare_at_price_including_vat_for is deprecated and will be removed in Spree 6.3. ' \
170
+ 'Prices are charged as entered; use #display_compare_at_price instead.'
171
+ )
161
172
  display_compare_at_price
162
173
  end
163
174
 
@@ -130,25 +130,31 @@ module Spree
130
130
  include Spree::HasStatus
131
131
  has_status :draft, :active, :inactive, :scheduled, default: :draft
132
132
 
133
- # @deprecated Call Spree.price_list_activate_workflow — removed in 6.1.
133
+ # @deprecated Call Spree.price_list_activate_workflow — removed in 6.3.
134
134
  # Kept literal: the old event always went straight to active, and the
135
135
  # workflow schedules a future-dated list instead. A caller relying on
136
136
  # this shell gets what it always got.
137
137
  def activate
138
- Spree::Deprecation.warn('Spree::PriceList#activate is deprecated and will be removed in Spree 6.1. Call Spree.price_list_activate_workflow instead.')
138
+ Spree::Deprecation.warn(
139
+ 'Spree::PriceList#activate is deprecated and will be removed in Spree 6.3. Call Spree.price_list_activate_workflow instead.'
140
+ )
139
141
  update(status: 'active')
140
142
  end
141
143
 
142
- # @deprecated Call Spree.price_list_deactivate_workflow — removed in 6.1.
144
+ # @deprecated Call Spree.price_list_deactivate_workflow — removed in 6.3.
143
145
  def deactivate
144
- Spree::Deprecation.warn('Spree::PriceList#deactivate is deprecated and will be removed in Spree 6.1. Call Spree.price_list_deactivate_workflow instead.')
146
+ Spree::Deprecation.warn(
147
+ 'Spree::PriceList#deactivate is deprecated and will be removed in Spree 6.3. Call Spree.price_list_deactivate_workflow instead.'
148
+ )
145
149
  Spree.price_list_deactivate_workflow.call(price_list: self).success?
146
150
  end
147
151
 
148
- # @deprecated Call Spree.price_list_activate_workflow — removed in 6.1.
152
+ # @deprecated Call Spree.price_list_activate_workflow — removed in 6.3.
149
153
  # It picks scheduled or active from the dates itself.
150
154
  def schedule
151
- Spree::Deprecation.warn('Spree::PriceList#schedule is deprecated and will be removed in Spree 6.1. Call Spree.price_list_activate_workflow instead.')
155
+ Spree::Deprecation.warn(
156
+ 'Spree::PriceList#schedule is deprecated and will be removed in Spree 6.3. Call Spree.price_list_activate_workflow instead.'
157
+ )
152
158
  update(status: 'scheduled')
153
159
  end
154
160
 
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  module PriceRules
3
- # Deprecated STI shell, removed in Spree 6.1. Exists only so price-rule
3
+ # Deprecated STI shell, removed in Spree 6.3. Exists only so price-rule
4
4
  # rows created before `spree:migrate_tax_zones` runs still load — the task
5
5
  # converts each row to a {MarketRule} where the zone's countries match a
6
6
  # market exactly, and otherwise deactivates the price list and removes the
@@ -89,7 +89,7 @@ module Spree
89
89
  # @deprecated The classification_count column was renamed to categories_count in 6.0.
90
90
  alias_attribute :classification_count, :categories_count
91
91
 
92
- # @deprecated Use #product_categories; removed in 6.1.
92
+ # @deprecated Use #product_categories; removed in 6.3.
93
93
  # The live row in the review trail, or nil for a product nobody submitted.
94
94
  #
95
95
  # @return [Spree::ProductSubmission, nil]
@@ -116,28 +116,28 @@ module Spree
116
116
  end
117
117
 
118
118
  def classifications
119
- Spree::Deprecation.warn('Spree::Product#classifications is deprecated and will be removed in Spree 6.1. Use #product_categories instead.')
119
+ Spree::Deprecation.warn('Spree::Product#classifications is deprecated and will be removed in Spree 6.3. Use #product_categories instead.')
120
120
  product_categories
121
121
  end
122
122
 
123
- # @deprecated Use #categories / #category_ids; removed in 6.1.
123
+ # @deprecated Use #categories / #category_ids; removed in 6.3.
124
124
  def taxons
125
- Spree::Deprecation.warn('Spree::Product#taxons is deprecated and will be removed in Spree 6.1. Use #categories instead.')
125
+ Spree::Deprecation.warn('Spree::Product#taxons is deprecated and will be removed in Spree 6.3. Use #categories instead.')
126
126
  categories
127
127
  end
128
128
 
129
129
  def taxons=(value)
130
- Spree::Deprecation.warn('Spree::Product#taxons= is deprecated and will be removed in Spree 6.1. Use #categories= instead.')
130
+ Spree::Deprecation.warn('Spree::Product#taxons= is deprecated and will be removed in Spree 6.3. Use #categories= instead.')
131
131
  self.categories = value
132
132
  end
133
133
 
134
134
  def taxon_ids
135
- Spree::Deprecation.warn('Spree::Product#taxon_ids is deprecated and will be removed in Spree 6.1. Use #category_ids instead.')
135
+ Spree::Deprecation.warn('Spree::Product#taxon_ids is deprecated and will be removed in Spree 6.3. Use #category_ids instead.')
136
136
  category_ids
137
137
  end
138
138
 
139
139
  def taxon_ids=(ids)
140
- Spree::Deprecation.warn('Spree::Product#taxon_ids= is deprecated and will be removed in Spree 6.1. Use #category_ids= instead.')
140
+ Spree::Deprecation.warn('Spree::Product#taxon_ids= is deprecated and will be removed in Spree 6.3. Use #category_ids= instead.')
141
141
  self.category_ids = ids
142
142
  end
143
143
 
@@ -424,21 +424,23 @@ module Spree
424
424
  include Spree::HasStatus
425
425
  has_status(*ALL_STATUSES, default: :draft)
426
426
 
427
- # @deprecated Call Spree.product_activate_workflow — removed in 6.1.
427
+ # @deprecated Call Spree.product_activate_workflow — removed in 6.3.
428
428
  def activate!
429
- Spree::Deprecation.warn('Spree::Product#activate! is deprecated and will be removed in Spree 6.1. Call Spree.product_activate_workflow instead.')
429
+ Spree::Deprecation.warn(
430
+ 'Spree::Product#activate! is deprecated and will be removed in Spree 6.3. Call Spree.product_activate_workflow instead.'
431
+ )
430
432
  run_status_workflow(Spree.product_activate_workflow)
431
433
  end
432
434
 
433
- # @deprecated Call Spree.product_archive_workflow — removed in 6.1.
435
+ # @deprecated Call Spree.product_archive_workflow — removed in 6.3.
434
436
  def archive!
435
- Spree::Deprecation.warn('Spree::Product#archive! is deprecated and will be removed in Spree 6.1. Call Spree.product_archive_workflow instead.')
437
+ Spree::Deprecation.warn('Spree::Product#archive! is deprecated and will be removed in Spree 6.3. Call Spree.product_archive_workflow instead.')
436
438
  run_status_workflow(Spree.product_archive_workflow)
437
439
  end
438
440
 
439
- # @deprecated Call Spree.product_draft_workflow — removed in 6.1.
441
+ # @deprecated Call Spree.product_draft_workflow — removed in 6.3.
440
442
  def draft!
441
- Spree::Deprecation.warn('Spree::Product#draft! is deprecated and will be removed in Spree 6.1. Call Spree.product_draft_workflow instead.')
443
+ Spree::Deprecation.warn('Spree::Product#draft! is deprecated and will be removed in Spree 6.3. Call Spree.product_draft_workflow instead.')
442
444
  run_status_workflow(Spree.product_draft_workflow)
443
445
  end
444
446
 
@@ -550,7 +552,7 @@ module Spree
550
552
 
551
553
  variant_count > 1
552
554
  end
553
- # @deprecated Use #has_multiple_variants? — will be removed in Spree 6.1.
555
+ # @deprecated Use #has_multiple_variants? — will be removed in Spree 6.3.
554
556
  alias has_variants? has_multiple_variants?
555
557
 
556
558
  # Returns the product's media gallery.
@@ -581,12 +583,12 @@ module Spree
581
583
  @variant_for_images ||= find_variant_for_images
582
584
  end
583
585
 
584
- # @deprecated Read #gallery_media directly; removed in 6.1. Nothing in
586
+ # @deprecated Read #gallery_media directly; removed in 6.3. Nothing in
585
587
  # Spree calls this — a hover image is a storefront presentation choice,
586
588
  # not something core should name.
587
589
  # @return [Spree::Media, nil]
588
590
  def secondary_image
589
- Spree::Deprecation.warn('Spree::Product#secondary_image is deprecated and will be removed in Spree 6.1. Use #gallery_media instead.')
591
+ Spree::Deprecation.warn('Spree::Product#secondary_image is deprecated and will be removed in Spree 6.3. Use #gallery_media instead.')
590
592
  gallery_media.second
591
593
  end
592
594
 
@@ -770,25 +772,25 @@ module Spree
770
772
  end
771
773
  end
772
774
 
773
- # @deprecated Use {#stock_levels}; removed in 6.1.
775
+ # @deprecated Use {#stock_levels}; removed in 6.3.
774
776
  def stock_items
775
- Spree::Deprecation.warn('Spree::Product#stock_items is deprecated and will be removed in Spree 6.1. Use #stock_levels instead.')
777
+ Spree::Deprecation.warn('Spree::Product#stock_items is deprecated and will be removed in Spree 6.3. Use #stock_levels instead.')
776
778
  stock_levels
777
779
  end
778
780
 
779
- # @deprecated Use #default_variant — the master variant is being removed in Spree 6.1.
781
+ # @deprecated Use #default_variant — the master variant is being removed in Spree 6.3.
780
782
  def master
781
- Spree::Deprecation.warn('Spree::Product#master is deprecated and will be removed in Spree 6.1. Use #default_variant instead.')
783
+ Spree::Deprecation.warn('Spree::Product#master is deprecated and will be removed in Spree 6.3. Use #default_variant instead.')
782
784
  default_variant
783
785
  end
784
786
 
785
- # @deprecated Use #variants — will be removed in Spree 6.1.
787
+ # @deprecated Use #variants — will be removed in Spree 6.3.
786
788
  def variants_including_master
787
- Spree::Deprecation.warn('Spree::Product#variants_including_master is deprecated and will be removed in Spree 6.1. Use #variants instead.')
789
+ Spree::Deprecation.warn('Spree::Product#variants_including_master is deprecated and will be removed in Spree 6.3. Use #variants instead.')
788
790
  variants
789
791
  end
790
792
 
791
- # @deprecated Use #default_variant_id — will be removed in Spree 6.1.
793
+ # @deprecated Use #default_variant_id — will be removed in Spree 6.3.
792
794
  def master_id
793
795
  default_variant_id
794
796
  end
@@ -803,7 +805,7 @@ module Spree
803
805
 
804
806
  # @deprecated Use {#primary_category}.
805
807
  def main_taxon
806
- Spree::Deprecation.warn('Spree::Product#main_taxon is deprecated and will be removed in Spree 6.1. Use #primary_category instead.')
808
+ Spree::Deprecation.warn('Spree::Product#main_taxon is deprecated and will be removed in Spree 6.3. Use #primary_category instead.')
807
809
  primary_category
808
810
  end
809
811
 
@@ -51,14 +51,14 @@ module Spree
51
51
  end
52
52
  }
53
53
 
54
- # @deprecated Use #category / #category=; removed in 6.1.
54
+ # @deprecated Use #category / #category=; removed in 6.3.
55
55
  def taxon
56
- Spree::Deprecation.warn('Spree::ProductCategory#taxon is deprecated and will be removed in Spree 6.1. Use #category instead.')
56
+ Spree::Deprecation.warn('Spree::ProductCategory#taxon is deprecated and will be removed in Spree 6.3. Use #category instead.')
57
57
  category
58
58
  end
59
59
 
60
60
  def taxon=(value)
61
- Spree::Deprecation.warn('Spree::ProductCategory#taxon= is deprecated and will be removed in Spree 6.1. Use #category= instead.')
61
+ Spree::Deprecation.warn('Spree::ProductCategory#taxon= is deprecated and will be removed in Spree 6.3. Use #category= instead.')
62
62
  self.category = value
63
63
  end
64
64
 
@@ -74,56 +74,73 @@ module Spree
74
74
  end
75
75
 
76
76
  #
77
- # Deprecated aliases (removed in 6.1)
77
+ # Deprecated aliases (removed in 6.3)
78
78
  #
79
79
  # @deprecated Use #categories.
80
80
  def taxons
81
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxons is deprecated and will be removed in Spree 6.1. Use #categories instead.')
81
+ Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxons is deprecated and will be removed in Spree 6.3. Use #categories instead.')
82
82
  categories
83
83
  end
84
84
 
85
85
  # @deprecated Use #categories=.
86
86
  def taxons=(value)
87
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxons= is deprecated and will be removed in Spree 6.1. Use #categories= instead.')
87
+ Spree::Deprecation.warn(
88
+ 'Spree::Promotion::Rules::Category#taxons= is deprecated and will be removed in Spree 6.3. Use #categories= instead.'
89
+ )
88
90
  self.categories = value
89
91
  end
90
92
 
91
93
  # @deprecated Use #category_ids.
92
94
  def taxon_ids
93
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids is deprecated and will be removed in Spree 6.1. Use #category_ids instead.')
95
+ Spree::Deprecation.warn(
96
+ 'Spree::Promotion::Rules::Category#taxon_ids is deprecated and will be removed in Spree 6.3. Use #category_ids instead.'
97
+ )
94
98
  category_ids
95
99
  end
96
100
 
97
101
  # @deprecated Use #category_ids=.
98
102
  def taxon_ids=(ids)
99
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids= is deprecated and will be removed in Spree 6.1. Use #category_ids= instead.')
103
+ Spree::Deprecation.warn(
104
+ 'Spree::Promotion::Rules::Category#taxon_ids= is deprecated and will be removed in Spree 6.3. Use #category_ids= instead.'
105
+ )
100
106
  self.category_ids = ids
101
107
  end
102
108
 
103
109
  # @deprecated Use #eligible_category_ids.
104
110
  def eligible_taxon_ids
105
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#eligible_taxon_ids is deprecated and will be removed in Spree 6.1. Use #eligible_category_ids instead.')
111
+ Spree::Deprecation.warn(
112
+ 'Spree::Promotion::Rules::Category#eligible_taxon_ids is deprecated and will be removed in Spree 6.3. ' \
113
+ 'Use #eligible_category_ids instead.'
114
+ )
106
115
  eligible_category_ids
107
116
  end
108
117
 
109
118
  # @deprecated Use #category_ids_to_add.
110
119
  def taxon_ids_to_add
111
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids_to_add is deprecated and will be removed in Spree 6.1. Use #category_ids_to_add instead.')
120
+ Spree::Deprecation.warn(
121
+ 'Spree::Promotion::Rules::Category#taxon_ids_to_add is deprecated and will be removed in Spree 6.3. Use #category_ids_to_add instead.'
122
+ )
112
123
  category_ids_to_add
113
124
  end
114
125
 
115
126
  def taxon_ids_to_add=(ids)
116
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids_to_add= is deprecated and will be removed in Spree 6.1. Use #category_ids_to_add= instead.')
127
+ Spree::Deprecation.warn(
128
+ 'Spree::Promotion::Rules::Category#taxon_ids_to_add= is deprecated and will be removed in Spree 6.3. Use #category_ids_to_add= instead.'
129
+ )
117
130
  self.category_ids_to_add = ids
118
131
  end
119
132
 
120
133
  def taxon_ids_string
121
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids_string is deprecated and will be removed in Spree 6.1. Use #category_ids instead.')
134
+ Spree::Deprecation.warn(
135
+ 'Spree::Promotion::Rules::Category#taxon_ids_string is deprecated and will be removed in Spree 6.3. Use #category_ids instead.'
136
+ )
122
137
  categories.pluck(:id).join(',')
123
138
  end
124
139
 
125
140
  def taxon_ids_string=(s)
126
- Spree::Deprecation.warn('Spree::Promotion::Rules::Category#taxon_ids_string= is deprecated and will be removed in Spree 6.1. Use #category_ids= instead.')
141
+ Spree::Deprecation.warn(
142
+ 'Spree::Promotion::Rules::Category#taxon_ids_string= is deprecated and will be removed in Spree 6.3. Use #category_ids= instead.'
143
+ )
127
144
  ids = s.to_s.split(',').map(&:strip)
128
145
  self.categories = Spree::Category.for_stores(stores).find(ids)
129
146
  end
@@ -69,7 +69,7 @@ module Spree
69
69
 
70
70
  # Countries stopped being records in 6.0, so a rule still configured
71
71
  # with the legacy row id is resolved by reading the table the upgrade
72
- # keeps until 6.1. Rules saved since store the ISO code directly.
72
+ # keeps until 6.3. Rules saved since store the ISO code directly.
73
73
  def legacy_country_code(country_id)
74
74
  connection = ActiveRecord::Base.connection
75
75
  return nil unless connection.table_exists?('spree_countries')
@@ -7,10 +7,12 @@ module Spree
7
7
  # Spree::Promotion::Rules::Taxon in 6.0. A true constant alias, so old STI type
8
8
  # strings (`'Spree::Promotion::Rules::Taxon'`) still instantiate correctly until
9
9
  # the Phase 4 migration rewrites them. The warning fires when this file loads.
10
- # Removed in 6.1.
10
+ # Removed in 6.3.
11
11
  Taxon = Category
12
12
 
13
- Spree::Deprecation.warn('Spree::Promotion::Rules::Taxon is deprecated and will be removed in Spree 6.1. Use Spree::Promotion::Rules::Category instead.')
13
+ Spree::Deprecation.warn(
14
+ 'Spree::Promotion::Rules::Taxon is deprecated and will be removed in Spree 6.3. Use Spree::Promotion::Rules::Category instead.'
15
+ )
14
16
  end
15
17
  end
16
18
  end
@@ -18,7 +18,7 @@ module Spree
18
18
  self.additional_permitted_attributes = [customer_ids: []]
19
19
 
20
20
  # Wire-format shorthand is `customer`; the rule class keeps the `User`
21
- # name until the 6.1 rename (see docs/plans/6.0-platform-auth.md).
21
+ # name until the 6.3 rename (see docs/plans/6.0-platform-auth.md).
22
22
  def self.api_type
23
23
  'customer'
24
24
  end
@@ -60,7 +60,7 @@ module Spree
60
60
  end
61
61
 
62
62
  # STI type names for a discount scope, covering both the 6.0 names and
63
- # the legacy names still present in the type column until the 6.1 data
63
+ # the legacy names still present in the type column until the 6.3 data
64
64
  # migration.
65
65
  #
66
66
  # @param scope [Symbol] :line_item, :fulfillment or :order
@@ -1,21 +1,21 @@
1
1
  module Spree
2
2
  # Join model between a Spree::Promotion::Rules::Category rule and a
3
- # Spree::Category. Renamed from Spree::PromotionRuleTaxon in 6.0 (alias kept for
4
- # one release).
3
+ # Spree::Category. Renamed from Spree::PromotionRuleTaxon in 6.0 (alias kept
4
+ # until 6.3).
5
5
  class PromotionRuleCategory < Spree.base_class
6
6
  belongs_to :promotion_rule, class_name: 'Spree::PromotionRule'
7
7
  belongs_to :category, class_name: 'Spree::Category'
8
8
 
9
9
  validates :promotion_rule_id, uniqueness: { scope: :category_id }, allow_nil: true
10
10
 
11
- # @deprecated Use #category / #category=; removed in 6.1.
11
+ # @deprecated Use #category / #category=; removed in 6.3.
12
12
  def taxon
13
- Spree::Deprecation.warn('Spree::PromotionRuleCategory#taxon is deprecated and will be removed in Spree 6.1. Use #category instead.')
13
+ Spree::Deprecation.warn('Spree::PromotionRuleCategory#taxon is deprecated and will be removed in Spree 6.3. Use #category instead.')
14
14
  category
15
15
  end
16
16
 
17
17
  def taxon=(value)
18
- Spree::Deprecation.warn('Spree::PromotionRuleCategory#taxon= is deprecated and will be removed in Spree 6.1. Use #category= instead.')
18
+ Spree::Deprecation.warn('Spree::PromotionRuleCategory#taxon= is deprecated and will be removed in Spree 6.3. Use #category= instead.')
19
19
  self.category = value
20
20
  end
21
21
  end
@@ -3,8 +3,8 @@
3
3
  module Spree
4
4
  # Deprecation alias for Spree::PromotionRuleCategory, renamed from
5
5
  # Spree::PromotionRuleTaxon in 6.0. A true constant alias (AR-safe); the warning
6
- # fires when this file loads. Removed in 6.1.
6
+ # fires when this file loads. Removed in 6.3.
7
7
  PromotionRuleTaxon = PromotionRuleCategory
8
8
 
9
- Spree::Deprecation.warn('Spree::PromotionRuleTaxon is deprecated and will be removed in Spree 6.1. Use Spree::PromotionRuleCategory instead.')
9
+ Spree::Deprecation.warn('Spree::PromotionRuleTaxon is deprecated and will be removed in Spree 6.3. Use Spree::PromotionRuleCategory instead.')
10
10
  end
@@ -1,5 +1,8 @@
1
1
  module Spree
2
2
  # Constant alias for the legacy Spree::Prototype class, renamed to
3
- # Spree::ProductType in 6.0. Remove in 6.1.
3
+ # Spree::ProductType in 6.0. The warning fires when this
4
+ # file loads. Removed in 6.3.
4
5
  Prototype = ProductType
6
+
7
+ Spree::Deprecation.warn('Spree::Prototype is deprecated and will be removed in Spree 6.3. Use Spree::ProductType instead.')
5
8
  end
@@ -2,13 +2,13 @@
2
2
 
3
3
  module Spree
4
4
  # Deprecation alias for Spree::ReturnReason, renamed in 6.0 along with the
5
- # removal of the ReturnAuthorization chain. Retained for one release so
6
- # existing code and extensions keep working; removed in 6.1.
5
+ # removal of the ReturnAuthorization chain. Retained until 6.3 so
6
+ # existing code and extensions keep working; removed in 6.3.
7
7
  #
8
8
  # A true constant alias — the class, table (spree_return_reasons), prefix
9
9
  # (rar) and model_name are all Spree::ReturnReason, so is_a?, polymorphic
10
10
  # type strings and class_name: references keep resolving correctly.
11
11
  ReturnAuthorizationReason = ReturnReason
12
12
 
13
- Spree::Deprecation.warn('Spree::ReturnAuthorizationReason is deprecated and will be removed in Spree 6.1. Use Spree::ReturnReason instead.')
13
+ Spree::Deprecation.warn('Spree::ReturnAuthorizationReason is deprecated and will be removed in Spree 6.3. Use Spree::ReturnReason instead.')
14
14
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  #
5
5
  # Renamed from Spree::ReturnAuthorizationReason in 6.0 now that the
6
6
  # ReturnAuthorization chain is gone; Spree::ReturnAuthorizationReason
7
- # remains as a deprecated alias for one release.
7
+ # remains as a deprecated alias until 6.3.
8
8
  class ReturnReason < Spree.base_class
9
9
  has_prefix_id :rar
10
10
 
@@ -27,9 +27,9 @@ module Spree
27
27
  @custom_field_schema ||= CustomFieldSchema.new(store, audience: audience)
28
28
  end
29
29
 
30
- # Deprecated 6.0 name, removed in 6.1.
30
+ # Deprecated 6.0 name, removed in 6.3.
31
31
  def metafield_schema
32
- Spree::Deprecation.warn('#metafield_schema is deprecated and will be removed in Spree 6.1. Use #custom_field_schema instead.')
32
+ Spree::Deprecation.warn('#metafield_schema is deprecated and will be removed in Spree 6.3. Use #custom_field_schema instead.')
33
33
  custom_field_schema
34
34
  end
35
35
 
@@ -2,7 +2,7 @@ module Spree
2
2
  module SearchProvider
3
3
  # Meilisearch moved out of core into the spree_meilisearch gem at 6.0, taking
4
4
  # the document presenter with it. Applications configure the provider by
5
- # class name, so resolve the old constants to the new ones for one release
5
+ # class name, so resolve the old constants to the new ones until 6.3
6
6
  # rather than failing at boot with a bare NameError.
7
7
  MOVED_TO_SPREE_MEILISEARCH = {
8
8
  Meilisearch: 'SpreeMeilisearch::SearchProvider',
@@ -18,10 +18,12 @@ module Spree
18
18
  "Add `gem 'spree_meilisearch'` to your Gemfile."
19
19
  end
20
20
 
21
- Spree::Deprecation.warn(
22
- "Spree::SearchProvider::#{name} is deprecated and will be removed in Spree 6.1. " \
23
- "Use #{replacement} instead."
24
- ) if defined?(Spree::Deprecation)
21
+ if defined?(Spree::Deprecation)
22
+ Spree::Deprecation.warn(
23
+ "Spree::SearchProvider::#{name} is deprecated and will be removed in Spree 6.3. " \
24
+ "Use #{replacement} instead."
25
+ )
26
+ end
25
27
 
26
28
  replacement.constantize
27
29
  end
@@ -1,5 +1,8 @@
1
1
  module Spree
2
2
  # Constant alias for the legacy Spree::Shipment, renamed to
3
- # Spree::Fulfillment in 6.0. Remove in 6.1.
3
+ # Spree::Fulfillment in 6.0. The warning fires when this
4
+ # file loads. Removed in 6.3.
4
5
  Shipment = Fulfillment
6
+
7
+ Spree::Deprecation.warn('Spree::Shipment is deprecated and will be removed in Spree 6.3. Use Spree::Fulfillment instead.')
5
8
  end
@@ -1,5 +1,8 @@
1
1
  module Spree
2
2
  # Constant alias for the legacy Spree::ShippingMethod, renamed to
3
- # Spree::DeliveryMethod in 6.0. Remove in 6.1.
3
+ # Spree::DeliveryMethod in 6.0. The warning fires when this
4
+ # file loads. Removed in 6.3.
4
5
  ShippingMethod = DeliveryMethod
6
+
7
+ Spree::Deprecation.warn('Spree::ShippingMethod is deprecated and will be removed in Spree 6.3. Use Spree::DeliveryMethod instead.')
5
8
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  # Constant alias for the legacy Spree::ShippingRate, renamed to
3
- # Spree::DeliveryRate in 6.0. Remove in 6.1.
3
+ # Spree::DeliveryRate in 6.0. Remove in 6.3.
4
4
  ShippingRate = DeliveryRate
5
5
  end
@@ -15,9 +15,9 @@ module Spree
15
15
  end
16
16
  end
17
17
 
18
- # @deprecated Use {#fulfillments}; removed in 6.1.
18
+ # @deprecated Use {#fulfillments}; removed in 6.3.
19
19
  def shipments
20
- Spree::Deprecation.warn('Spree::Stock::Coordinator#shipments is deprecated and will be removed in Spree 6.1. Use #fulfillments instead.')
20
+ Spree::Deprecation.warn('Spree::Stock::Coordinator#shipments is deprecated and will be removed in Spree 6.3. Use #fulfillments instead.')
21
21
  fulfillments
22
22
  end
23
23
 
@@ -32,9 +32,9 @@ module Spree
32
32
  delivery_methods(package, audience).any?
33
33
  end
34
34
 
35
- # @deprecated Use {#delivery_rates}; removed in 6.1.
35
+ # @deprecated Use {#delivery_rates}; removed in 6.3.
36
36
  def shipping_rates(package, audience = DeliveryMethod::STOREFRONT)
37
- Spree::Deprecation.warn('Spree::Stock::Estimator#shipping_rates is deprecated and will be removed in Spree 6.1. Use #delivery_rates instead.')
37
+ Spree::Deprecation.warn('Spree::Stock::Estimator#shipping_rates is deprecated and will be removed in Spree 6.3. Use #delivery_rates instead.')
38
38
  delivery_rates(package, audience)
39
39
  end
40
40
 
@@ -141,7 +141,7 @@ module Spree
141
141
  # their own rules.
142
142
  #
143
143
  # Dispatches through the legacy +shipping_methods+ name so overrides
144
- # written against it keep running until 6.1 — without this, a host
144
+ # written against it keep running until 6.3 — without this, a host
145
145
  # override would be silently skipped and checkout could quote rates
146
146
  # the host meant to filter out.
147
147
  def delivery_methods(package, audience)
@@ -150,11 +150,13 @@ module Spree
150
150
  filter_delivery_methods(package, audience)
151
151
  end
152
152
 
153
- # @deprecated Call or override {#delivery_methods}; removed in 6.1.
153
+ # @deprecated Call or override {#delivery_methods}; removed in 6.3.
154
154
  # Only reached when a caller uses the old name directly — the override
155
155
  # dispatch above goes straight to the override's own definition.
156
156
  def shipping_methods(package, audience)
157
- Spree::Deprecation.warn('Spree::Stock::Estimator#shipping_methods is deprecated and will be removed in Spree 6.1. Use #delivery_methods instead.')
157
+ Spree::Deprecation.warn(
158
+ 'Spree::Stock::Estimator#shipping_methods is deprecated and will be removed in Spree 6.3. Use #delivery_methods instead.'
159
+ )
158
160
  filter_delivery_methods(package, audience)
159
161
  end
160
162
 
@@ -30,15 +30,15 @@ module Spree
30
30
  @owner || order
31
31
  end
32
32
 
33
- # @deprecated Use {#delivery_rates}; removed in 6.1.
33
+ # @deprecated Use {#delivery_rates}; removed in 6.3.
34
34
  def shipping_rates
35
- Spree::Deprecation.warn('Spree::Stock::Package#shipping_rates is deprecated and will be removed in Spree 6.1. Use #delivery_rates instead.')
35
+ Spree::Deprecation.warn('Spree::Stock::Package#shipping_rates is deprecated and will be removed in Spree 6.3. Use #delivery_rates instead.')
36
36
  delivery_rates
37
37
  end
38
38
 
39
- # @deprecated Use {#delivery_rates=}; removed in 6.1.
39
+ # @deprecated Use {#delivery_rates=}; removed in 6.3.
40
40
  def shipping_rates=(rates)
41
- Spree::Deprecation.warn('Spree::Stock::Package#shipping_rates= is deprecated and will be removed in Spree 6.1. Use #delivery_rates= instead.')
41
+ Spree::Deprecation.warn('Spree::Stock::Package#shipping_rates= is deprecated and will be removed in Spree 6.3. Use #delivery_rates= instead.')
42
42
  self.delivery_rates = rates
43
43
  end
44
44
 
@@ -154,9 +154,11 @@ module Spree
154
154
  profile.delivery_methods
155
155
  end
156
156
 
157
- # @deprecated Use {#eligible_delivery_methods}; removed in 6.1.
157
+ # @deprecated Use {#eligible_delivery_methods}; removed in 6.3.
158
158
  def shipping_methods
159
- Spree::Deprecation.warn('Spree::Stock::Package#shipping_methods is deprecated and will be removed in Spree 6.1. Use #eligible_delivery_methods instead.')
159
+ Spree::Deprecation.warn(
160
+ 'Spree::Stock::Package#shipping_methods is deprecated and will be removed in Spree 6.3. Use #eligible_delivery_methods instead.'
161
+ )
160
162
  eligible_delivery_methods.to_a
161
163
  end
162
164
 
@@ -179,9 +181,9 @@ module Spree
179
181
  )
180
182
  end
181
183
 
182
- # @deprecated Use {#to_fulfillment}; removed in 6.1.
184
+ # @deprecated Use {#to_fulfillment}; removed in 6.3.
183
185
  def to_shipment
184
- Spree::Deprecation.warn('Spree::Stock::Package#to_shipment is deprecated and will be removed in Spree 6.1. Use #to_fulfillment instead.')
186
+ Spree::Deprecation.warn('Spree::Stock::Package#to_shipment is deprecated and will be removed in Spree 6.3. Use #to_fulfillment instead.')
185
187
  to_fulfillment
186
188
  end
187
189
 
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  # Constant alias for the legacy Spree::StockItem, renamed to
3
- # Spree::StockLevel in 6.0. Remove in 6.1.
3
+ # Spree::StockLevel in 6.0. Remove in 6.3.
4
4
  StockItem = StockLevel
5
5
  end