spree_core 6.0.3 → 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 (221) 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/payments/handle_webhook_job.rb +12 -1
  5. data/app/jobs/spree/products/auto_match_taxons_job.rb +5 -2
  6. data/app/jobs/spree/search_provider/index_job.rb +8 -0
  7. data/app/jobs/spree/search_provider/remove_job.rb +3 -0
  8. data/app/jobs/spree/stock_locations/stock_items/create_job.rb +5 -2
  9. data/app/mailers/spree/base_mailer.rb +1 -1
  10. data/app/models/concerns/spree/acted_by.rb +2 -2
  11. data/app/models/concerns/spree/customer_methods.rb +6 -4
  12. data/app/models/concerns/spree/deprecated_customer_alias.rb +11 -3
  13. data/app/models/concerns/spree/derived_number.rb +1 -1
  14. data/app/models/concerns/spree/has_custom_fields.rb +16 -11
  15. data/app/models/concerns/spree/integrations_concern.rb +5 -3
  16. data/app/models/concerns/spree/label_translatable.rb +4 -4
  17. data/app/models/concerns/spree/metadata.rb +3 -3
  18. data/app/models/concerns/spree/personal_data_matching.rb +5 -1
  19. data/app/models/concerns/spree/presentation_translatable.rb +1 -1
  20. data/app/models/concerns/spree/product_scopes.rb +2 -2
  21. data/app/models/concerns/spree/publishable.rb +26 -3
  22. data/app/models/concerns/spree/purchase/addresses.rb +8 -5
  23. data/app/models/concerns/spree/purchase/deprecated_aliases.rb +2 -2
  24. data/app/models/concerns/spree/stores/markets.rb +4 -2
  25. data/app/models/concerns/spree/user_address.rb +5 -2
  26. data/app/models/concerns/spree/user_methods.rb +2 -2
  27. data/app/models/spree/address.rb +29 -14
  28. data/app/models/spree/asset.rb +3 -3
  29. data/app/models/spree/authentication/strategies/base_strategy.rb +10 -1
  30. data/app/models/spree/base.rb +1 -1
  31. data/app/models/spree/calculator/shipping/flat_rate.rb +6 -4
  32. data/app/models/spree/cart.rb +9 -4
  33. data/app/models/spree/category.rb +8 -6
  34. data/app/models/spree/classification.rb +2 -2
  35. data/app/models/spree/current.rb +19 -0
  36. data/app/models/spree/custom_field.rb +6 -6
  37. data/app/models/spree/custom_field_definition.rb +10 -7
  38. data/app/models/spree/delivery_method.rb +21 -15
  39. data/app/models/spree/delivery_rate.rb +1 -1
  40. data/app/models/spree/digital.rb +1 -1
  41. data/app/models/spree/digital_asset.rb +2 -2
  42. data/app/models/spree/digital_link.rb +4 -4
  43. data/app/models/spree/export.rb +29 -2
  44. data/app/models/spree/fulfillment/custom_events.rb +18 -10
  45. data/app/models/spree/fulfillment.rb +30 -23
  46. data/app/models/spree/fulfillment_item.rb +3 -3
  47. data/app/models/spree/fulfilment_changer.rb +1 -1
  48. data/app/models/spree/gift_card.rb +12 -12
  49. data/app/models/spree/import.rb +23 -15
  50. data/app/models/spree/import_row.rb +6 -6
  51. data/app/models/spree/inventory_unit.rb +1 -1
  52. data/app/models/spree/invitation.rb +14 -6
  53. data/app/models/spree/line_item.rb +10 -8
  54. data/app/models/spree/media.rb +27 -3
  55. data/app/models/spree/metafield.rb +1 -1
  56. data/app/models/spree/metafield_definition.rb +1 -1
  57. data/app/models/spree/metafields.rb +2 -2
  58. data/app/models/spree/option_type.rb +26 -0
  59. data/app/models/spree/option_value.rb +3 -3
  60. data/app/models/spree/order.rb +92 -46
  61. data/app/models/spree/order_inventory.rb +2 -2
  62. data/app/models/spree/order_merger.rb +2 -2
  63. data/app/models/spree/order_updater.rb +34 -20
  64. data/app/models/spree/payment.rb +8 -8
  65. data/app/models/spree/payment_method.rb +11 -9
  66. data/app/models/spree/price.rb +22 -8
  67. data/app/models/spree/price_list.rb +12 -6
  68. data/app/models/spree/price_rules/zone_rule.rb +1 -1
  69. data/app/models/spree/product.rb +32 -33
  70. data/app/models/spree/product_category.rb +10 -4
  71. data/app/models/spree/product_collection.rb +8 -1
  72. data/app/models/spree/promotion/rules/category.rb +27 -10
  73. data/app/models/spree/promotion/rules/country.rb +1 -1
  74. data/app/models/spree/promotion/rules/taxon.rb +4 -2
  75. data/app/models/spree/promotion/rules/user.rb +1 -1
  76. data/app/models/spree/promotion_action.rb +1 -1
  77. data/app/models/spree/promotion_rule_category.rb +5 -5
  78. data/app/models/spree/promotion_rule_taxon.rb +2 -2
  79. data/app/models/spree/prototype.rb +4 -1
  80. data/app/models/spree/return_authorization_reason.rb +3 -3
  81. data/app/models/spree/return_reason.rb +1 -1
  82. data/app/models/spree/search_provider/base.rb +2 -2
  83. data/app/models/spree/search_provider.rb +7 -5
  84. data/app/models/spree/seller.rb +93 -10
  85. data/app/models/spree/seller_requirements/complete_profile.rb +26 -7
  86. data/app/models/spree/shipment.rb +4 -1
  87. data/app/models/spree/shipping_method.rb +4 -1
  88. data/app/models/spree/shipping_rate.rb +1 -1
  89. data/app/models/spree/stock/coordinator.rb +2 -2
  90. data/app/models/spree/stock/estimator.rb +7 -5
  91. data/app/models/spree/stock/package.rb +10 -8
  92. data/app/models/spree/stock_item.rb +1 -1
  93. data/app/models/spree/stock_level/custom_events.rb +1 -1
  94. data/app/models/spree/stock_level.rb +31 -2
  95. data/app/models/spree/stock_location.rb +12 -8
  96. data/app/models/spree/stock_movement.rb +7 -6
  97. data/app/models/spree/stock_reservation.rb +5 -5
  98. data/app/models/spree/store.rb +42 -16
  99. data/app/models/spree/store_credit.rb +2 -2
  100. data/app/models/spree/store_credit_category.rb +5 -5
  101. data/app/models/spree/store_credit_type.rb +2 -2
  102. data/app/models/spree/subscriber.rb +7 -7
  103. data/app/models/spree/tax_rate.rb +5 -5
  104. data/app/models/spree/taxon.rb +3 -3
  105. data/app/models/spree/taxon_rule.rb +2 -2
  106. data/app/models/spree/taxonomy.rb +1 -1
  107. data/app/models/spree/variant.rb +12 -10
  108. data/app/models/spree/variant_media.rb +1 -1
  109. data/app/models/spree/wished_item.rb +1 -1
  110. data/app/models/spree/wishlist.rb +2 -2
  111. data/app/models/spree/wishlist_item/custom_events.rb +2 -2
  112. data/app/models/spree/zone.rb +1 -1
  113. data/app/models/spree/zone_member.rb +1 -1
  114. data/app/services/spree/carts/associate.rb +6 -2
  115. data/app/services/spree/carts/create.rb +1 -1
  116. data/app/services/spree/carts/destroy.rb +23 -7
  117. data/app/services/spree/carts/remove_item.rb +1 -1
  118. data/app/services/spree/carts/remove_line_item.rb +2 -2
  119. data/app/services/spree/carts/remove_out_of_stock_items.rb +3 -1
  120. data/app/services/spree/carts/set_quantity.rb +2 -2
  121. data/app/services/spree/carts/update.rb +17 -0
  122. data/app/services/spree/checkout/add_store_credit.rb +3 -3
  123. data/app/services/spree/checkout/remove_store_credit.rb +2 -2
  124. data/app/services/spree/collections/regenerate_products.rb +37 -15
  125. data/app/services/spree/companies/add_member.rb +9 -4
  126. data/app/services/spree/diagnostics/error_log.rb +139 -0
  127. data/app/services/spree/diagnostics/section.rb +72 -0
  128. data/app/services/spree/diagnostics/sections.rb +121 -0
  129. data/app/services/spree/diagnostics/stack.rb +73 -0
  130. data/app/services/spree/diagnostics.rb +132 -0
  131. data/app/services/spree/imports/row_processors/product_variant.rb +19 -0
  132. data/app/services/spree/newsletter/subscribe.rb +7 -3
  133. data/app/services/spree/orders/approve.rb +3 -3
  134. data/app/services/spree/orders/create_user_account.rb +2 -2
  135. data/app/services/spree/orders/remove_line_item.rb +16 -5
  136. data/app/services/spree/product_memberships.rb +21 -1
  137. data/app/services/spree/product_types/apply_to_products.rb +12 -2
  138. data/app/services/spree/products/auto_match_collections.rb +20 -4
  139. data/app/services/spree/products/auto_match_taxons.rb +5 -2
  140. data/app/services/spree/shipments/update.rb +2 -2
  141. data/app/services/spree/stock_locations/stock_items/create.rb +5 -2
  142. data/app/services/spree/stock_reservations/extend.rb +3 -1
  143. data/app/services/spree/stock_reservations/reserve.rb +12 -7
  144. data/app/services/spree/store_credits/apply.rb +9 -1
  145. data/app/services/spree/taxons/add_products.rb +4 -2
  146. data/app/services/spree/taxons/regenerate_products.rb +5 -2
  147. data/app/services/spree/taxons/remove_products.rb +4 -2
  148. data/app/services/spree/update_check.rb +7 -31
  149. data/app/tools/spree/agent_tools/describe_resource.rb +3 -0
  150. data/app/tools/spree/agent_tools/get_resource.rb +1 -1
  151. data/app/tools/spree/agent_tools/resource_write.rb +1 -1
  152. data/app/tools/spree/agent_tools/search_resources.rb +42 -10
  153. data/app/workflows/spree/carts/add_item.rb +52 -1
  154. data/app/workflows/spree/carts/complete.rb +14 -2
  155. data/app/workflows/spree/carts/recalculate.rb +1 -1
  156. data/app/workflows/spree/fulfillments/update.rb +1 -1
  157. data/app/workflows/spree/orders/cancel.rb +3 -1
  158. data/app/workflows/spree/payments/capture.rb +2 -2
  159. data/app/workflows/spree/payments/handle_webhook.rb +7 -3
  160. data/app/workflows/spree/seller_transfers/create.rb +1 -1
  161. data/app/workflows/spree/sellers/approve.rb +6 -0
  162. data/app/workflows/spree/sellers/create.rb +5 -2
  163. data/app/workflows/spree/stock_levels/bulk_upsert.rb +19 -7
  164. data/config/locales/be.yml +1 -1
  165. data/config/locales/en.yml +12 -0
  166. data/config/locales/fr.yml +1 -1
  167. data/config/locales/lt.yml +1 -1
  168. data/config/locales/ru.yml +1 -1
  169. data/config/locales/uk.yml +1 -1
  170. data/db/migrate/20240303174340_fix_spree_stock_item_unique_index.rb +14 -10
  171. data/db/migrate/20260710000001_rename_taxons_to_categories.rb +1 -1
  172. data/db/migrate/20260728000004_rename_shipping_to_fulfillment_and_delivery.rb +1 -1
  173. data/db/migrate/20260806000001_add_store_id_to_spree_tax_rates_and_categories.rb +1 -1
  174. data/db/migrate/20260807130001_add_country_state_codes_to_consumers.rb +1 -1
  175. data/db/migrate/20260809000001_rename_metafields_to_custom_fields.rb +1 -1
  176. data/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb +1 -1
  177. data/db/migrate/20260811000001_add_delivery_tracking_to_fulfillments.rb +1 -1
  178. data/db/migrate/20260814000001_rename_stock_items_to_stock_levels.rb +13 -7
  179. data/db/migrate/20260824000001_add_store_to_spree_media.rb +1 -1
  180. data/db/migrate/20260828100001_unify_import_and_export_tenancy.rb +1 -1
  181. data/db/migrate/20261016000001_remove_default_from_spree_tax_rates_included_in_price.rb +1 -1
  182. data/lib/spree/agent_tool.rb +3 -3
  183. data/lib/spree/agent_tools/default_catalog.rb +2 -2
  184. data/lib/spree/agent_tools/legacy_tools.rb +1 -1
  185. data/lib/spree/agent_tools/operation_tool.rb +1 -1
  186. data/lib/spree/agent_tools/record_summary.rb +8 -2
  187. data/lib/spree/agent_tools/resource_map.rb +82 -7
  188. data/lib/spree/core/dependencies.rb +10 -10
  189. data/lib/spree/core/engine.rb +14 -0
  190. data/lib/spree/core/number_generator.rb +4 -3
  191. data/lib/spree/core/preferences/preferable.rb +1 -1
  192. data/lib/spree/core/preferences/preferable_class_methods.rb +5 -1
  193. data/lib/spree/core/pricing/resolver.rb +2 -2
  194. data/lib/spree/core/version.rb +1 -1
  195. data/lib/spree/core.rb +48 -10
  196. data/lib/spree/i18n.rb +6 -2
  197. data/lib/spree/localized_number.rb +1 -1
  198. data/lib/spree/removed_apis.rb +274 -0
  199. data/lib/spree/reporting/default_vocabulary.rb +26 -6
  200. data/lib/spree/testing_support/factories/digital_asset_factory.rb +1 -1
  201. data/lib/spree/testing_support/factories/stock_level_factory.rb +1 -1
  202. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  203. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  204. data/lib/spree/testing_support/factories/wishlist_item_factory.rb +1 -1
  205. data/lib/spree/testing_support/i18n.rb +7 -2
  206. data/lib/spree/testing_support/order_walkthrough.rb +5 -2
  207. data/lib/spree/upgrades/5_6_to_6_0/manifest.yml +14 -14
  208. data/lib/tasks/carts_migration.rake +1 -1
  209. data/lib/tasks/categories_and_collections.rake +1 -1
  210. data/lib/tasks/deliveries_migration.rake +1 -1
  211. data/lib/tasks/delivery_method_rules_migration.rake +1 -1
  212. data/lib/tasks/delivery_migration.rake +1 -1
  213. data/lib/tasks/delivery_profiles_migration.rake +2 -2
  214. data/lib/tasks/diagnostics.rake +11 -0
  215. data/lib/tasks/fold_store_credit_categories.rake +1 -1
  216. data/lib/tasks/migrate_country_state_codes.rake +1 -1
  217. data/lib/tasks/migrate_returns.rake +4 -4
  218. data/lib/tasks/migrate_rich_text_to_columns.rake +1 -1
  219. data/lib/tasks/store_settings.rake +1 -1
  220. data/lib/tasks/typed_stock_movements_migration.rake +1 -1
  221. metadata +13 -6
@@ -76,14 +76,14 @@ module Spree
76
76
  delegate :name, :label, to: :option_type, prefix: true, allow_nil: true
77
77
 
78
78
  # @deprecated The delegated name follows the renamed column since 6.0;
79
- # removed in 6.1.
79
+ # removed in 6.3.
80
80
  alias option_type_presentation option_type_label
81
81
 
82
82
  # Using map here instead of pluck, as these values are translatable via Mobility gem
83
83
  # @deprecated Legacy Tom Select helper for the removed Rails admin. No replacement.
84
84
  # @return [Array<Hash>]
85
85
  def self.to_tom_select_json
86
- Spree::Deprecation.warn('Spree::OptionValue.to_tom_select_json is deprecated and will be removed in Spree 6.1.')
86
+ Spree::Deprecation.warn('Spree::OptionValue.to_tom_select_json is deprecated and will be removed in Spree 6.3.')
87
87
 
88
88
  all.map do |ov|
89
89
  {
@@ -97,7 +97,7 @@ module Spree
97
97
  # @deprecated No replacement, build the label in the presentation layer instead.
98
98
  # @return [String]
99
99
  def display_presentation
100
- Spree::Deprecation.warn('Spree::OptionValue#display_presentation is deprecated and will be removed in Spree 6.1.')
100
+ Spree::Deprecation.warn('Spree::OptionValue#display_presentation is deprecated and will be removed in Spree 6.3.')
101
101
 
102
102
  @display_presentation ||= "#{option_type.label}: #{label}"
103
103
  end
@@ -12,13 +12,13 @@ module Spree
12
12
  # What Orders::UpdateStatuses derives — the only writer of the column.
13
13
  PAYMENT_STATUSES = %w(none authorized partially_paid paid partially_refunded refunded overcharged voided).freeze
14
14
  # @deprecated legacy machine vocabulary; rows carrying it stay valid until
15
- # the status migration rewrites them. Removed in 6.1.
15
+ # the status migration rewrites them. Removed in 6.3.
16
16
  PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
17
17
  FULFILLMENT_STATUSES = %w(backorder canceled partial unfulfilled fulfilled delivered pending ready shipped)
18
- # @deprecated legacy name — remove in 6.1 together with the 'shipped' value
18
+ # @deprecated legacy name — remove in 6.3 together with the 'shipped' value
19
19
  SHIPMENT_STATES = FULFILLMENT_STATUSES
20
20
  # @deprecated legacy machine vocabulary — line-item removability is
21
- # completion-based since 6.0; removed in 6.1.
21
+ # completion-based since 6.0; removed in 6.3.
22
22
  LINE_ITEM_REMOVABLE_STATES = %w(cart address delivery payment confirm resumed)
23
23
 
24
24
  extend Spree::DisplayMoney
@@ -84,7 +84,9 @@ module Spree
84
84
  # would drop warnings already recorded upstream.
85
85
  # @deprecated Only Carts can auto remove out of stock items
86
86
  def remove_out_of_stock_items!
87
- Spree::Deprecation.warn('Spree::Order#remove_out_of_stock_items! is deprecated and will be removed in Spree 6.1. This method now works only on Spree::Cart objects')
87
+ Spree::Deprecation.warn(
88
+ 'Spree::Order#remove_out_of_stock_items! is deprecated and will be removed in Spree 6.3. This method now works only on Spree::Cart objects'
89
+ )
88
90
 
89
91
  existing_warnings = warnings
90
92
  result = Spree.cart_remove_out_of_stock_items_service.call(cart: self)
@@ -105,41 +107,59 @@ module Spree
105
107
  # Where the checkout stands within that list is not, which is why the
106
108
  # readers below report a finished checkout.
107
109
 
108
- # @deprecated Checkout steps belong to Spree::Cart; removed in 6.1.
110
+ # @deprecated Checkout steps belong to Spree::Cart; removed in 6.3.
109
111
  def checkout_steps
110
- Spree::Deprecation.warn('Spree::Order#checkout_steps is deprecated and will be removed in Spree 6.1. Checkout steps belong to Spree::Cart — ask the cart before it is completed.')
112
+ Spree::Deprecation.warn(
113
+ 'Spree::Order#checkout_steps is deprecated and will be removed in Spree 6.3. ' \
114
+ 'Checkout steps belong to Spree::Cart — ask the cart before it is completed.'
115
+ )
111
116
  Spree::Checkout::Registry.step_names_for(self)
112
117
  end
113
118
 
114
- # @deprecated See {#checkout_steps}; removed in 6.1.
119
+ # @deprecated See {#checkout_steps}; removed in 6.3.
115
120
  def has_checkout_step?(step)
116
- Spree::Deprecation.warn('Spree::Order#has_checkout_step? is deprecated and will be removed in Spree 6.1. Checkout steps belong to Spree::Cart — ask the cart before it is completed.')
121
+ Spree::Deprecation.warn(
122
+ 'Spree::Order#has_checkout_step? is deprecated and will be removed in Spree 6.3. ' \
123
+ 'Checkout steps belong to Spree::Cart — ask the cart before it is completed.'
124
+ )
117
125
  step.present? && Spree::Checkout::Registry.step_names_for(self).include?(step.to_s)
118
126
  end
119
127
 
120
- # @deprecated See {#checkout_steps}; removed in 6.1.
128
+ # @deprecated See {#checkout_steps}; removed in 6.3.
121
129
  def checkout_step_index(step)
122
- Spree::Deprecation.warn('Spree::Order#checkout_step_index is deprecated and will be removed in Spree 6.1. Checkout steps belong to Spree::Cart — ask the cart before it is completed.')
130
+ Spree::Deprecation.warn(
131
+ 'Spree::Order#checkout_step_index is deprecated and will be removed in Spree 6.3. ' \
132
+ 'Checkout steps belong to Spree::Cart — ask the cart before it is completed.'
133
+ )
123
134
  Spree::Checkout::Registry.step_names_for(self).index(step).to_i
124
135
  end
125
136
 
126
- # @deprecated See {#checkout_steps}; removed in 6.1. An order has no
137
+ # @deprecated See {#checkout_steps}; removed in 6.3. An order has no
127
138
  # outstanding step, so this is always 'complete'.
128
139
  def current_checkout_step
129
- Spree::Deprecation.warn("Spree::Order#current_checkout_step is deprecated and will be removed in Spree 6.1. An order is past checkout, so this is always 'complete'.")
140
+ Spree::Deprecation.warn(
141
+ 'Spree::Order#current_checkout_step is deprecated and will be removed in Spree 6.3. ' \
142
+ "An order is past checkout, so this is always 'complete'."
143
+ )
130
144
  'complete'
131
145
  end
132
146
 
133
- # @deprecated See {#checkout_steps}; removed in 6.1.
147
+ # @deprecated See {#checkout_steps}; removed in 6.3.
134
148
  def final_checkout_step
135
- Spree::Deprecation.warn('Spree::Order#final_checkout_step is deprecated and will be removed in Spree 6.1. Checkout steps belong to Spree::Cart — ask the cart before it is completed.')
149
+ Spree::Deprecation.warn(
150
+ 'Spree::Order#final_checkout_step is deprecated and will be removed in Spree 6.3. ' \
151
+ 'Checkout steps belong to Spree::Cart — ask the cart before it is completed.'
152
+ )
136
153
  Spree::Checkout::Registry.step_names_for(self).reject { |step| step == 'complete' }.last || 'address'
137
154
  end
138
155
 
139
- # @deprecated See {#checkout_steps}; removed in 6.1. Every step is behind
156
+ # @deprecated See {#checkout_steps}; removed in 6.3. Every step is behind
140
157
  # an order, so this is the whole list bar 'complete'.
141
158
  def completed_checkout_steps
142
- Spree::Deprecation.warn("Spree::Order#completed_checkout_steps is deprecated and will be removed in Spree 6.1. An order is past checkout, so every step bar 'complete' is behind it.")
159
+ Spree::Deprecation.warn(
160
+ 'Spree::Order#completed_checkout_steps is deprecated and will be removed in Spree 6.3. ' \
161
+ "An order is past checkout, so every step bar 'complete' is behind it."
162
+ )
143
163
  Spree::Checkout::Registry.step_names_for(self).reject { |step| step == 'complete' }
144
164
  end
145
165
 
@@ -274,11 +294,11 @@ module Spree
274
294
  has_many :fulfillment_discounts, through: :fulfillments, source: :discounts
275
295
 
276
296
  alias items line_items
277
- # Legacy names — removed in 6.1 (real names: fulfillments, delivery_total,
297
+ # Legacy names — removed in 6.3 (real names: fulfillments, delivery_total,
278
298
  # fulfillment_status since 6.0)
279
299
  has_many :shipments, class_name: 'Spree::Fulfillment', inverse_of: :order, deprecated: true
280
300
  alias_attribute :shipment_state, :fulfillment_status
281
- # Deprecated alias — the column is payment_status since 6.0; remove in 6.1.
301
+ # Deprecated alias — the column is payment_status since 6.0; remove in 6.3.
282
302
  alias_attribute :payment_state, :payment_status
283
303
 
284
304
  delegate :has_markets?, to: :store, prefix: true
@@ -286,7 +306,7 @@ module Spree
286
306
  accepts_nested_attributes_for :line_items
287
307
  accepts_nested_attributes_for :payments, reject_if: :credit_card_nil_payment?
288
308
  accepts_nested_attributes_for :fulfillments
289
- # @deprecated legacy writer — removed in 6.1
309
+ # @deprecated legacy writer — removed in 6.3
290
310
  alias shipments_attributes= fulfillments_attributes=
291
311
 
292
312
  before_create :link_by_email
@@ -303,13 +323,13 @@ module Spree
303
323
  validates :fulfillment_status, inclusion: { in: FULFILLMENT_STATUSES, allow_blank: true }
304
324
 
305
325
  # @deprecated Both warn and run the full recalculation; use
306
- # {#recalculate_totals!}. Removed in 6.1.
326
+ # {#recalculate_totals!}. Removed in 6.3.
307
327
  delegate :update_totals, :persist_totals, to: :updater
308
328
  delegate :merge!, to: :merger
309
329
  delegate :first_name, :last_name, to: :bill_address, prefix: true, allow_nil: true
310
330
 
311
331
  # @deprecated The delegated names follow the renamed address columns since
312
- # 6.0; removed in 6.1.
332
+ # 6.0; removed in 6.3.
313
333
  alias bill_address_firstname bill_address_first_name
314
334
  alias bill_address_lastname bill_address_last_name
315
335
 
@@ -360,7 +380,11 @@ module Spree
360
380
  conditions << search_condition(Spree::Address, :last_name, full_name.last)
361
381
  end
362
382
 
363
- left_joins(:bill_address).where(arel_table[:email].lower.eq(query.downcase)).or(where(conditions.reduce(:or)))
383
+ # The exact match goes through the model, so it still finds an order in
384
+ # an app that encrypts email, where SQL only ever sees ciphertext.
385
+ left_joins(:bill_address).where(email: query).
386
+ or(left_joins(:bill_address).where(arel_table[:email].lower.eq(query.downcase))).
387
+ or(where(conditions.reduce(:or)))
364
388
  end
365
389
 
366
390
  # Find an order by prefixed ID first, falling back to number, then integer id for backwards compatibility
@@ -396,7 +420,7 @@ module Spree
396
420
  # Use this method in other gems that wish to register their own custom logic
397
421
  # that should be called after Order#update
398
422
  def self.register_update_hook(hook)
399
- Spree::Deprecation.warn('Order.register_update_hook is deprecated and will be removed in Spree 6.1')
423
+ Spree::Deprecation.warn('Order.register_update_hook is deprecated and will be removed in Spree 6.3')
400
424
  update_hooks.add(hook)
401
425
  end
402
426
 
@@ -412,7 +436,7 @@ module Spree
412
436
 
413
437
  # Promotion actions of the given discount scope, covering both the 6.0
414
438
  # class names and the legacy STI names still present in the type column
415
- # until the 6.1 data migration.
439
+ # until the 6.3 data migration.
416
440
  def promotion_actions_of_scope(scope)
417
441
  Spree::PromotionAction.where(type: Spree::PromotionAction.types_for_discount_scope(scope))
418
442
  end
@@ -441,7 +465,7 @@ module Spree
441
465
  end
442
466
 
443
467
  # @deprecated machine vocabulary — data-derived bridge for the 6.0
444
- # transition, removed in 6.1. An order is "cart-like" while a draft
468
+ # transition, removed in 6.3. An order is "cart-like" while a draft
445
469
  # with no checkout data.
446
470
  def cart?
447
471
  draft? && !completed? && email.blank? && ship_address_id.blank?
@@ -605,7 +629,7 @@ module Spree
605
629
  end
606
630
 
607
631
  # @deprecated Use {#recalculate_totals!} for money and {#update_statuses!}
608
- # for payment/fulfillment statuses; removed in 6.1.
632
+ # for payment/fulfillment statuses; removed in 6.3.
609
633
  def updater
610
634
  @updater ||= Spree.order_updater.new(self)
611
635
  end
@@ -624,7 +648,7 @@ module Spree
624
648
  Spree.order_update_statuses_service.call(order: self)
625
649
  end
626
650
 
627
- # @deprecated Use {Spree::Carts::Merge}; removed in 6.1.
651
+ # @deprecated Use {Spree::Carts::Merge}; removed in 6.3.
628
652
  def merger
629
653
  @merger ||= Spree::OrderMerger.new(self)
630
654
  end
@@ -657,9 +681,9 @@ module Spree
657
681
  update!(nullified_attributes)
658
682
  end
659
683
 
660
- # @deprecated Use {#disassociate_customer!}; removed in 6.1.
684
+ # @deprecated Use {#disassociate_customer!}; removed in 6.3.
661
685
  def disassociate_user!
662
- Spree::Deprecation.warn('Spree::Order#disassociate_user! is deprecated and will be removed in Spree 6.1. Use #disassociate_customer! instead.')
686
+ Spree::Deprecation.warn('Spree::Order#disassociate_user! is deprecated and will be removed in Spree 6.3. Use #disassociate_customer! instead.')
663
687
  disassociate_customer!
664
688
  end
665
689
 
@@ -826,9 +850,12 @@ module Spree
826
850
  # Finalizes an in progress order after checkout is complete.
827
851
  # Called after transition to complete state when payments will have been processed
828
852
  # @deprecated Completion lives in {Spree::Orders::Complete} (checkout
829
- # reaches it through +Spree.carts_complete_workflow+). Removed in 6.1.
853
+ # reaches it through +Spree.carts_complete_workflow+). Removed in 6.3.
830
854
  def finalize!
831
- Spree::Deprecation.warn('Spree::Order#finalize! is deprecated and will be removed in Spree 6.1. Completion runs through Spree.order_complete_workflow (Spree::Orders::Complete).')
855
+ Spree::Deprecation.warn(
856
+ 'Spree::Order#finalize! is deprecated and will be removed in Spree 6.3. ' \
857
+ 'Completion runs through Spree.order_complete_workflow (Spree::Orders::Complete).'
858
+ )
832
859
  Spree.order_complete_workflow.call(order: self, payment_pending: true, validated: true)
833
860
  end
834
861
 
@@ -848,9 +875,12 @@ module Spree
848
875
  # If so add error and restart checkout.
849
876
  # @deprecated Completion validation lives in
850
877
  # {Spree::Checkout::DefaultRequirements} (the +discontinued+ stock
851
- # error). Removed in 6.1.
878
+ # error). Removed in 6.3.
852
879
  def ensure_line_item_variants_are_not_discontinued
853
- Spree::Deprecation.warn('Spree::Order#ensure_line_item_variants_are_not_discontinued is deprecated and will be removed in Spree 6.1. Completion validation lives in Spree::Checkout::Requirements.')
880
+ Spree::Deprecation.warn(
881
+ 'Spree::Order#ensure_line_item_variants_are_not_discontinued is deprecated and will be removed in Spree 6.3. ' \
882
+ 'Completion validation lives in Spree::Checkout::Requirements.'
883
+ )
854
884
  if line_items.any? { |li| !li.variant || li.variant.discontinued? }
855
885
  errors.add(:base, :discontinued_variants_present, message: I18n.t('spree.discontinued_variants_present'))
856
886
  false
@@ -861,9 +891,12 @@ module Spree
861
891
 
862
892
  # @deprecated Completion validation lives in
863
893
  # {Spree::Checkout::DefaultRequirements} (the +out_of_stock+ stock
864
- # error). Removed in 6.1.
894
+ # error). Removed in 6.3.
865
895
  def ensure_line_items_are_in_stock
866
- Spree::Deprecation.warn('Spree::Order#ensure_line_items_are_in_stock is deprecated and will be removed in Spree 6.1. Completion validation lives in Spree::Checkout::Requirements.')
896
+ Spree::Deprecation.warn(
897
+ 'Spree::Order#ensure_line_items_are_in_stock is deprecated and will be removed in Spree 6.3. ' \
898
+ 'Completion validation lives in Spree::Checkout::Requirements.'
899
+ )
867
900
  if insufficient_stock_lines.present?
868
901
  errors.add(:base, :insufficient_stock_lines_present, message: I18n.t('spree.insufficient_stock_lines_present'))
869
902
  false
@@ -873,14 +906,18 @@ module Spree
873
906
  end
874
907
 
875
908
  def use_all_coupon_codes
876
- Spree::Deprecation.warn('Spree::Order#use_all_coupon_codes is deprecated and will be removed in Spree 6.1. Use Spree::CouponCodes::CouponCodesHandler instead.')
909
+ Spree::Deprecation.warn(
910
+ 'Spree::Order#use_all_coupon_codes is deprecated and will be removed in Spree 6.3. Use Spree::CouponCodes::CouponCodesHandler instead.'
911
+ )
877
912
  Spree::CouponCodes::CouponCodesHandler.new(order: self).use_all_codes
878
913
  end
879
914
 
880
915
  normalizes :coupon_code, with: ->(code) { code.to_s.strip.downcase.presence }
881
916
 
882
917
  def can_add_coupon?
883
- Spree::Deprecation.warn('Spree::Order#can_add_coupon? is deprecated and will be removed in Spree 6.1. Use Spree::Promotion.order_activatable? instead.')
918
+ Spree::Deprecation.warn(
919
+ 'Spree::Order#can_add_coupon? is deprecated and will be removed in Spree 6.3. Use Spree::Promotion.order_activatable? instead.'
920
+ )
884
921
  Spree::Promotion.order_activatable?(self)
885
922
  end
886
923
 
@@ -902,9 +939,9 @@ module Spree
902
939
  total.positive? && fulfillments.delivered.size == total
903
940
  end
904
941
 
905
- # @deprecated Use {#fully_fulfilled?}; removed in 6.1.
942
+ # @deprecated Use {#fully_fulfilled?}; removed in 6.3.
906
943
  def fully_shipped?
907
- Spree::Deprecation.warn('Spree::Order#fully_shipped? is deprecated and will be removed in Spree 6.1. Use #fully_fulfilled? instead.')
944
+ Spree::Deprecation.warn('Spree::Order#fully_shipped? is deprecated and will be removed in Spree 6.3. Use #fully_fulfilled? instead.')
908
945
  fully_fulfilled?
909
946
  end
910
947
 
@@ -987,9 +1024,12 @@ module Spree
987
1024
  end.flatten.compact
988
1025
  end
989
1026
 
990
- # @deprecated Use {#line_items_without_delivery_rates}; removed in 6.1.
1027
+ # @deprecated Use {#line_items_without_delivery_rates}; removed in 6.3.
991
1028
  def line_items_without_shipping_rates
992
- Spree::Deprecation.warn('Spree::Order#line_items_without_shipping_rates is deprecated and will be removed in Spree 6.1. Use #line_items_without_delivery_rates instead.')
1029
+ Spree::Deprecation.warn(
1030
+ 'Spree::Order#line_items_without_shipping_rates is deprecated and will be removed in Spree 6.3. ' \
1031
+ 'Use #line_items_without_delivery_rates instead.'
1032
+ )
993
1033
  line_items_without_delivery_rates
994
1034
  end
995
1035
 
@@ -1030,9 +1070,11 @@ module Spree
1030
1070
  fulfillments.map { |fulfillment| fulfillment.refresh_rates(audience) }
1031
1071
  end
1032
1072
 
1033
- # @deprecated Use {#refresh_delivery_rates}; removed in 6.1.
1073
+ # @deprecated Use {#refresh_delivery_rates}; removed in 6.3.
1034
1074
  def refresh_shipment_rates(audience = DeliveryMethod::STOREFRONT)
1035
- Spree::Deprecation.warn('Spree::Order#refresh_shipment_rates is deprecated and will be removed in Spree 6.1. Use #refresh_delivery_rates instead.')
1075
+ Spree::Deprecation.warn(
1076
+ 'Spree::Order#refresh_shipment_rates is deprecated and will be removed in Spree 6.3. Use #refresh_delivery_rates instead.'
1077
+ )
1036
1078
  refresh_delivery_rates(audience)
1037
1079
  end
1038
1080
 
@@ -1042,7 +1084,7 @@ module Spree
1042
1084
  end
1043
1085
 
1044
1086
  def shipping_method
1045
- Spree::Deprecation.warn('Spree::Order#shipping_method is deprecated and will be removed in Spree 6.1. Please use Spree::Order#delivery_method')
1087
+ Spree::Deprecation.warn('Spree::Order#shipping_method is deprecated and will be removed in Spree 6.3. Please use Spree::Order#delivery_method')
1046
1088
  delivery_method
1047
1089
  end
1048
1090
 
@@ -1072,7 +1114,9 @@ module Spree
1072
1114
  # @param canceled_at [Time, nil] the time of cancellation (defaults to current time)
1073
1115
  # @return [Spree::ServiceModule::Result]
1074
1116
  def canceled_by(user, canceled_at = nil)
1075
- Spree::Deprecation.warn('Spree::Order#canceled_by is deprecated and will be removed in Spree 6.1. Use Spree.order_cancel_workflow (Spree::Orders::Cancel) instead.')
1117
+ Spree::Deprecation.warn(
1118
+ 'Spree::Order#canceled_by is deprecated and will be removed in Spree 6.3. Use Spree.order_cancel_workflow (Spree::Orders::Cancel) instead.'
1119
+ )
1076
1120
  Spree.order_cancel_workflow.call(order: self, canceler: user, canceled_at: canceled_at)
1077
1121
  end
1078
1122
 
@@ -1168,7 +1212,9 @@ module Spree
1168
1212
  # without fulfillment discounts (eg. Free Shipping)
1169
1213
  # @return [BigDecimal]
1170
1214
  def cart_promo_total
1171
- Spree::Deprecation.warn('Spree::Order#cart_promo_total is deprecated and will be removed in Spree 6.1. Please use order.cart.discount_total instead')
1215
+ Spree::Deprecation.warn(
1216
+ 'Spree::Order#cart_promo_total is deprecated and will be removed in Spree 6.3. Please use order.cart.discount_total instead'
1217
+ )
1172
1218
  discounts.promotion.nonzero.for_line_items.sum(:amount)
1173
1219
  end
1174
1220
 
@@ -10,9 +10,9 @@ module Spree
10
10
 
11
11
  delegate :fulfillment_items, to: :line_item
12
12
 
13
- # @deprecated Use {#fulfillment_items}; removed in 6.1.
13
+ # @deprecated Use {#fulfillment_items}; removed in 6.3.
14
14
  def inventory_units
15
- Spree::Deprecation.warn('Spree::OrderInventory#inventory_units is deprecated and will be removed in Spree 6.1. Use #fulfillment_items instead.')
15
+ Spree::Deprecation.warn('Spree::OrderInventory#inventory_units is deprecated and will be removed in Spree 6.3. Use #fulfillment_items instead.')
16
16
  fulfillment_items
17
17
  end
18
18
 
@@ -1,12 +1,12 @@
1
1
  module Spree
2
2
  # @deprecated Use {Spree::Carts::Merge} (guest cart adoption on sign-in);
3
- # removed in 6.1.
3
+ # removed in 6.3.
4
4
  class OrderMerger
5
5
  attr_accessor :order
6
6
  delegate :updater, to: :order
7
7
 
8
8
  def initialize(order)
9
- Spree::Deprecation.warn('Spree::OrderMerger is deprecated and will be removed in Spree 6.1. Use Spree::Carts::Merge instead.')
9
+ Spree::Deprecation.warn('Spree::OrderMerger is deprecated and will be removed in Spree 6.3. Use Spree::Carts::Merge instead.')
10
10
  @order = order
11
11
  end
12
12
 
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- # @deprecated Removed in Spree 6.1. Every method is a thin shim over the
2
+ # @deprecated Removed in Spree 6.3. Every method is a thin shim over the
3
3
  # flows that own the work:
4
4
  #
5
5
  # * money — {Spree::Carts::RecalculateTotals} /
@@ -21,14 +21,14 @@ module Spree
21
21
 
22
22
  # @deprecated Use {Spree::Carts::RecalculateTotals} /
23
23
  # {Spree::Orders::RecalculateTotals} (or +#recalculate_totals!+);
24
- # removed in 6.1.
24
+ # removed in 6.3.
25
25
  def update
26
26
  deprecate_totals(__method__)
27
27
  recalculate_totals
28
28
  update_statuses if order.completed?
29
29
  end
30
30
 
31
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1. The
31
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3. The
32
32
  # totals workflow rebuilds the typed adjustment rows as part of its
33
33
  # money pass.
34
34
  def recalculate_adjustments
@@ -36,62 +36,65 @@ module Spree
36
36
  recalculate_totals
37
37
  end
38
38
 
39
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
39
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
40
40
  def update_totals
41
41
  deprecate_totals(__method__)
42
42
  recalculate_totals
43
43
  end
44
44
 
45
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
45
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
46
46
  def update_payment_total
47
47
  deprecate_totals(__method__)
48
48
  recalculate_totals
49
49
  order.payment_total
50
50
  end
51
51
 
52
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
52
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
53
53
  def update_item_total
54
54
  deprecate_totals(__method__)
55
55
  recalculate_totals
56
56
  order.item_total
57
57
  end
58
58
 
59
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
59
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
60
60
  def update_order_total
61
61
  deprecate_totals(__method__)
62
62
  recalculate_totals
63
63
  order.total
64
64
  end
65
65
 
66
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
66
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
67
67
  def update_adjustment_total
68
68
  deprecate_totals(__method__)
69
69
  recalculate_totals
70
70
  order.adjustment_total
71
71
  end
72
72
 
73
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
73
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
74
74
  def update_item_count
75
75
  deprecate_totals(__method__)
76
76
  recalculate_totals
77
77
  order.total_quantity
78
78
  end
79
79
 
80
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
80
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
81
81
  def persist_totals
82
82
  deprecate_totals(__method__)
83
83
  recalculate_totals
84
84
  end
85
85
 
86
- # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.1.
86
+ # @deprecated Use {Spree::Carts::RecalculateTotals}; removed in 6.3.
87
87
  def update_shipment_total
88
- Spree::Deprecation.warn('Spree::OrderUpdater#update_shipment_total is deprecated and will be removed in Spree 6.1. Use Spree::Carts::RecalculateTotals / Spree::Orders::RecalculateTotals (or #recalculate_totals!) instead.')
88
+ Spree::Deprecation.warn(
89
+ 'Spree::OrderUpdater#update_shipment_total is deprecated and will be removed in Spree 6.3. ' \
90
+ 'Use Spree::Carts::RecalculateTotals / Spree::Orders::RecalculateTotals (or #recalculate_totals!) instead.'
91
+ )
89
92
  recalculate_totals
90
93
  order.delivery_total
91
94
  end
92
95
 
93
96
  # @deprecated Use {Spree::Orders::UpdateStatuses} (or
94
- # +#update_statuses!+); removed in 6.1. UpdateStatuses writes the 6.0
97
+ # +#update_statuses!+); removed in 6.3. UpdateStatuses writes the 6.0
95
98
  # vocabulary (none/authorized/partially_paid/paid/partially_refunded/
96
99
  # refunded/overcharged/voided), not the legacy balance_due/credit_owed/
97
100
  # failed/void names.
@@ -102,7 +105,7 @@ module Spree
102
105
  end
103
106
 
104
107
  # @deprecated Use {Spree::Orders::UpdateStatuses} (or
105
- # +#update_statuses!+); removed in 6.1.
108
+ # +#update_statuses!+); removed in 6.3.
106
109
  def update_shipment_state
107
110
  deprecate_statuses(__method__)
108
111
  update_statuses
@@ -111,9 +114,12 @@ module Spree
111
114
 
112
115
  # @deprecated Use {Spree::Orders::UpdateStatuses} for the state roll-up
113
116
  # and {Spree::Carts::Recalculate} for the delivery proposal rebuild;
114
- # removed in 6.1.
117
+ # removed in 6.3.
115
118
  def update_shipments
116
- Spree::Deprecation.warn('Spree::OrderUpdater#update_shipments is deprecated and will be removed in Spree 6.1. Use Spree::Orders::UpdateStatuses (fulfillment states) and Spree::Carts::Recalculate (delivery proposals) instead.')
119
+ Spree::Deprecation.warn(
120
+ 'Spree::OrderUpdater#update_shipments is deprecated and will be removed in Spree 6.3. ' \
121
+ 'Use Spree::Orders::UpdateStatuses (fulfillment states) and Spree::Carts::Recalculate (delivery proposals) instead.'
122
+ )
117
123
 
118
124
  audience = order.completed? ? DeliveryMethod::BACKOFFICE : DeliveryMethod::STOREFRONT
119
125
 
@@ -128,10 +134,12 @@ module Spree
128
134
  end
129
135
  end
130
136
 
131
- # @deprecated Order update hooks are removed in 6.1 — subscribe to the
137
+ # @deprecated Order update hooks are removed in 6.3 — subscribe to the
132
138
  # +order.updated+ event instead.
133
139
  def run_hooks
134
- Spree::Deprecation.warn('Spree::OrderUpdater#run_hooks is deprecated and will be removed in Spree 6.1. Subscribe to the order.updated event instead.')
140
+ Spree::Deprecation.warn(
141
+ 'Spree::OrderUpdater#run_hooks is deprecated and will be removed in Spree 6.3. Subscribe to the order.updated event instead.'
142
+ )
135
143
  update_hooks.each { |hook| order.send hook }
136
144
  end
137
145
 
@@ -162,11 +170,17 @@ module Spree
162
170
  end
163
171
 
164
172
  def deprecate_totals(method_name)
165
- Spree::Deprecation.warn("Spree::OrderUpdater##{method_name} is deprecated and will be removed in Spree 6.1. Use Spree::Carts::RecalculateTotals / Spree::Orders::RecalculateTotals (or #recalculate_totals!) instead.")
173
+ Spree::Deprecation.warn(
174
+ "Spree::OrderUpdater##{method_name} is deprecated and will be removed in Spree 6.3. " \
175
+ 'Use Spree::Carts::RecalculateTotals / Spree::Orders::RecalculateTotals (or #recalculate_totals!) instead.'
176
+ )
166
177
  end
167
178
 
168
179
  def deprecate_statuses(method_name)
169
- Spree::Deprecation.warn("Spree::OrderUpdater##{method_name} is deprecated and will be removed in Spree 6.1. Use Spree::Orders::UpdateStatuses (or #update_statuses!) instead.")
180
+ Spree::Deprecation.warn(
181
+ "Spree::OrderUpdater##{method_name} is deprecated and will be removed in Spree 6.3. " \
182
+ 'Use Spree::Orders::UpdateStatuses (or #update_statuses!) instead.'
183
+ )
170
184
  end
171
185
  end
172
186
  end
@@ -89,7 +89,7 @@ module Spree
89
89
  default_scope { order(:created_at) }
90
90
 
91
91
  scope :from_credit_card, -> { where(source_type: 'Spree::CreditCard') }
92
- # @deprecated use the status scopes / +where(status:)+ — removed in 6.1
92
+ # @deprecated use the status scopes / +where(status:)+ — removed in 6.3
93
93
  scope :with_state, ->(s) { where(status: s.to_s) }
94
94
  # "offset" is reserved by activerecord
95
95
  scope :offset_payment, -> { where("source_type = 'Spree::Payment' AND amount < 0 AND status = 'completed'") }
@@ -105,7 +105,7 @@ module Spree
105
105
  scope :not_store_credits, -> { where(arel_table[:source_type].not_eq(Spree::StoreCredit.to_s).or(arel_table[:source_type].eq(nil))) }
106
106
 
107
107
  self.whitelisted_ransackable_associations = %w[payment_method order source]
108
- ransack_alias :state, :status # @deprecated filter alias — removed in 6.1
108
+ ransack_alias :state, :status # @deprecated filter alias — removed in 6.5
109
109
  # `number` is deliberately absent: it is derived (its column is NULL on
110
110
  # 6.0 rows), so a filter on it silently matches nothing. The 6.1 payment
111
111
  # `reference` becomes the searchable identifier
@@ -238,15 +238,15 @@ module Spree
238
238
  (!payment_method.respond_to?(:can_capture?) || payment_method.can_capture?(self))
239
239
  end
240
240
 
241
- # @deprecated read +status+ — removed in 6.1
241
+ # @deprecated read +status+ — removed in 6.3
242
242
  def state
243
- Spree::Deprecation.warn('Spree::Payment#state is deprecated and will be removed in Spree 6.1. Use #status instead.')
243
+ Spree::Deprecation.warn('Spree::Payment#state is deprecated and will be removed in Spree 6.3. Use #status instead.')
244
244
  status
245
245
  end
246
246
 
247
- # @deprecated write +status+ — removed in 6.1
247
+ # @deprecated write +status+ — removed in 6.3
248
248
  def state=(value)
249
- Spree::Deprecation.warn('Spree::Payment#state= is deprecated and will be removed in Spree 6.1. Use #status= instead.')
249
+ Spree::Deprecation.warn('Spree::Payment#state= is deprecated and will be removed in Spree 6.3. Use #status= instead.')
250
250
  self.status = value
251
251
  end
252
252
 
@@ -464,9 +464,9 @@ module Spree
464
464
  INVALID_STATUSES.include?(status)
465
465
  end
466
466
 
467
- # @deprecated use {#has_invalid_status?} — removed in 6.1
467
+ # @deprecated use {#has_invalid_status?} — removed in 6.3
468
468
  def has_invalid_state?
469
- Spree::Deprecation.warn('Spree::Payment#has_invalid_state? is deprecated and will be removed in Spree 6.1. Use #has_invalid_status? instead.')
469
+ Spree::Deprecation.warn('Spree::Payment#has_invalid_state? is deprecated and will be removed in Spree 6.3. Use #has_invalid_status? instead.')
470
470
  has_invalid_status?
471
471
  end
472
472
 
@@ -24,7 +24,7 @@ module Spree
24
24
  # Spree::Money (amount and currency) and convert it to the provider's own
25
25
  # unit. Methods that have not opted in receive an integer in hundredths of
26
26
  # the currency, which is wrong for yen and dinar; that bridge is removed in
27
- # Spree 6.1.
27
+ # Spree 6.5.
28
28
  class_attribute :accepts_money_amounts, default: false, instance_writer: false
29
29
 
30
30
  # Blank falls back to the store, so a method only overrides when a merchant
@@ -286,7 +286,7 @@ module Spree
286
286
  store_preference(:capture_method).presence || Spree::CaptureMethod::DEFAULT_CAPTURE_METHOD
287
287
  end
288
288
 
289
- # @deprecated Use #capture_at_checkout?; removed in 6.1. Deliberately does
289
+ # @deprecated Use #capture_at_checkout?; removed in 6.3. Deliberately does
290
290
  # not warn — it runs on every payment and would flood the logs.
291
291
  def auto_capture?
292
292
  capture_at_checkout?
@@ -342,21 +342,23 @@ module Spree
342
342
  public_preference_keys.index_with { |key| get_preference(key) }
343
343
  end
344
344
 
345
- # @deprecated Use {#storefront_visible?}; removed in 6.1.
345
+ # @deprecated Use {#storefront_visible?}; removed in 6.3.
346
346
  def available_on_front_end?
347
- Spree::Deprecation.warn('Spree::PaymentMethod#available_on_front_end? is deprecated and will be removed in Spree 6.1. Use #storefront_visible? instead.')
347
+ Spree::Deprecation.warn(
348
+ 'Spree::PaymentMethod#available_on_front_end? is deprecated and will be removed in Spree 6.3. Use #storefront_visible? instead.'
349
+ )
348
350
  storefront_visible?
349
351
  end
350
352
 
351
- # @deprecated Use {#storefront_visible}; removed in 6.1.
353
+ # @deprecated Use {#storefront_visible}; removed in 6.3.
352
354
  def display_on
353
- Spree::Deprecation.warn('Spree::PaymentMethod#display_on is deprecated and will be removed in Spree 6.1. Use #storefront_visible instead.')
355
+ Spree::Deprecation.warn('Spree::PaymentMethod#display_on is deprecated and will be removed in Spree 6.3. Use #storefront_visible instead.')
354
356
  storefront_visible? ? 'both' : 'back_end'
355
357
  end
356
358
 
357
- # @deprecated Use {#storefront_visible=}; removed in 6.1.
359
+ # @deprecated Use {#storefront_visible=}; removed in 6.3.
358
360
  def display_on=(value)
359
- Spree::Deprecation.warn('Spree::PaymentMethod#display_on= is deprecated and will be removed in Spree 6.1. Use #storefront_visible= instead.')
361
+ Spree::Deprecation.warn('Spree::PaymentMethod#display_on= is deprecated and will be removed in Spree 6.3. Use #storefront_visible= instead.')
360
362
  self.storefront_visible = value.to_s != 'back_end'
361
363
  end
362
364
 
@@ -398,7 +400,7 @@ module Spree
398
400
  Spree::Deprecation.warn(
399
401
  "#{self.class.name} receives amounts as an integer in hundredths, which is wrong for currencies " \
400
402
  'without two decimals. Set `self.accepts_money_amounts = true` and take a Spree::Money ' \
401
- '(amount and currency); hundredths are removed in Spree 6.1.'
403
+ '(amount and currency); hundredths are removed in Spree 6.5.'
402
404
  )
403
405
  end
404
406
  end