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.
- checksums.yaml +4 -4
- data/app/jobs/spree/imports/create_rows_job.rb +4 -2
- data/app/jobs/spree/imports/process_rows_job.rb +4 -2
- data/app/jobs/spree/payments/handle_webhook_job.rb +12 -1
- data/app/jobs/spree/products/auto_match_taxons_job.rb +5 -2
- data/app/jobs/spree/search_provider/index_job.rb +8 -0
- data/app/jobs/spree/search_provider/remove_job.rb +3 -0
- data/app/jobs/spree/stock_locations/stock_items/create_job.rb +5 -2
- data/app/mailers/spree/base_mailer.rb +1 -1
- data/app/models/concerns/spree/acted_by.rb +2 -2
- data/app/models/concerns/spree/customer_methods.rb +6 -4
- data/app/models/concerns/spree/deprecated_customer_alias.rb +11 -3
- data/app/models/concerns/spree/derived_number.rb +1 -1
- data/app/models/concerns/spree/has_custom_fields.rb +16 -11
- data/app/models/concerns/spree/integrations_concern.rb +5 -3
- data/app/models/concerns/spree/label_translatable.rb +4 -4
- data/app/models/concerns/spree/metadata.rb +3 -3
- data/app/models/concerns/spree/personal_data_matching.rb +5 -1
- data/app/models/concerns/spree/presentation_translatable.rb +1 -1
- data/app/models/concerns/spree/product_scopes.rb +2 -2
- data/app/models/concerns/spree/publishable.rb +26 -3
- data/app/models/concerns/spree/purchase/addresses.rb +8 -5
- data/app/models/concerns/spree/purchase/deprecated_aliases.rb +2 -2
- data/app/models/concerns/spree/stores/markets.rb +4 -2
- data/app/models/concerns/spree/user_address.rb +5 -2
- data/app/models/concerns/spree/user_methods.rb +2 -2
- data/app/models/spree/address.rb +29 -14
- data/app/models/spree/asset.rb +3 -3
- data/app/models/spree/authentication/strategies/base_strategy.rb +10 -1
- data/app/models/spree/base.rb +1 -1
- data/app/models/spree/calculator/shipping/flat_rate.rb +6 -4
- data/app/models/spree/cart.rb +9 -4
- data/app/models/spree/category.rb +8 -6
- data/app/models/spree/classification.rb +2 -2
- data/app/models/spree/current.rb +19 -0
- data/app/models/spree/custom_field.rb +6 -6
- data/app/models/spree/custom_field_definition.rb +10 -7
- data/app/models/spree/delivery_method.rb +21 -15
- data/app/models/spree/delivery_rate.rb +1 -1
- data/app/models/spree/digital.rb +1 -1
- data/app/models/spree/digital_asset.rb +2 -2
- data/app/models/spree/digital_link.rb +4 -4
- data/app/models/spree/export.rb +29 -2
- data/app/models/spree/fulfillment/custom_events.rb +18 -10
- data/app/models/spree/fulfillment.rb +30 -23
- data/app/models/spree/fulfillment_item.rb +3 -3
- data/app/models/spree/fulfilment_changer.rb +1 -1
- data/app/models/spree/gift_card.rb +12 -12
- data/app/models/spree/import.rb +23 -15
- data/app/models/spree/import_row.rb +6 -6
- data/app/models/spree/inventory_unit.rb +1 -1
- data/app/models/spree/invitation.rb +14 -6
- data/app/models/spree/line_item.rb +10 -8
- data/app/models/spree/media.rb +27 -3
- data/app/models/spree/metafield.rb +1 -1
- data/app/models/spree/metafield_definition.rb +1 -1
- data/app/models/spree/metafields.rb +2 -2
- data/app/models/spree/option_type.rb +26 -0
- data/app/models/spree/option_value.rb +3 -3
- data/app/models/spree/order.rb +92 -46
- data/app/models/spree/order_inventory.rb +2 -2
- data/app/models/spree/order_merger.rb +2 -2
- data/app/models/spree/order_updater.rb +34 -20
- data/app/models/spree/payment.rb +8 -8
- data/app/models/spree/payment_method.rb +11 -9
- data/app/models/spree/price.rb +22 -8
- data/app/models/spree/price_list.rb +12 -6
- data/app/models/spree/price_rules/zone_rule.rb +1 -1
- data/app/models/spree/product.rb +32 -33
- data/app/models/spree/product_category.rb +10 -4
- data/app/models/spree/product_collection.rb +8 -1
- data/app/models/spree/promotion/rules/category.rb +27 -10
- data/app/models/spree/promotion/rules/country.rb +1 -1
- data/app/models/spree/promotion/rules/taxon.rb +4 -2
- data/app/models/spree/promotion/rules/user.rb +1 -1
- data/app/models/spree/promotion_action.rb +1 -1
- data/app/models/spree/promotion_rule_category.rb +5 -5
- data/app/models/spree/promotion_rule_taxon.rb +2 -2
- data/app/models/spree/prototype.rb +4 -1
- data/app/models/spree/return_authorization_reason.rb +3 -3
- data/app/models/spree/return_reason.rb +1 -1
- data/app/models/spree/search_provider/base.rb +2 -2
- data/app/models/spree/search_provider.rb +7 -5
- data/app/models/spree/seller.rb +93 -10
- data/app/models/spree/seller_requirements/complete_profile.rb +26 -7
- data/app/models/spree/shipment.rb +4 -1
- data/app/models/spree/shipping_method.rb +4 -1
- data/app/models/spree/shipping_rate.rb +1 -1
- data/app/models/spree/stock/coordinator.rb +2 -2
- data/app/models/spree/stock/estimator.rb +7 -5
- data/app/models/spree/stock/package.rb +10 -8
- data/app/models/spree/stock_item.rb +1 -1
- data/app/models/spree/stock_level/custom_events.rb +1 -1
- data/app/models/spree/stock_level.rb +31 -2
- data/app/models/spree/stock_location.rb +12 -8
- data/app/models/spree/stock_movement.rb +7 -6
- data/app/models/spree/stock_reservation.rb +5 -5
- data/app/models/spree/store.rb +42 -16
- data/app/models/spree/store_credit.rb +2 -2
- data/app/models/spree/store_credit_category.rb +5 -5
- data/app/models/spree/store_credit_type.rb +2 -2
- data/app/models/spree/subscriber.rb +7 -7
- data/app/models/spree/tax_rate.rb +5 -5
- data/app/models/spree/taxon.rb +3 -3
- data/app/models/spree/taxon_rule.rb +2 -2
- data/app/models/spree/taxonomy.rb +1 -1
- data/app/models/spree/variant.rb +12 -10
- data/app/models/spree/variant_media.rb +1 -1
- data/app/models/spree/wished_item.rb +1 -1
- data/app/models/spree/wishlist.rb +2 -2
- data/app/models/spree/wishlist_item/custom_events.rb +2 -2
- data/app/models/spree/zone.rb +1 -1
- data/app/models/spree/zone_member.rb +1 -1
- data/app/services/spree/carts/associate.rb +6 -2
- data/app/services/spree/carts/create.rb +1 -1
- data/app/services/spree/carts/destroy.rb +23 -7
- data/app/services/spree/carts/remove_item.rb +1 -1
- data/app/services/spree/carts/remove_line_item.rb +2 -2
- data/app/services/spree/carts/remove_out_of_stock_items.rb +3 -1
- data/app/services/spree/carts/set_quantity.rb +2 -2
- data/app/services/spree/carts/update.rb +17 -0
- data/app/services/spree/checkout/add_store_credit.rb +3 -3
- data/app/services/spree/checkout/remove_store_credit.rb +2 -2
- data/app/services/spree/collections/regenerate_products.rb +37 -15
- data/app/services/spree/companies/add_member.rb +9 -4
- data/app/services/spree/diagnostics/error_log.rb +139 -0
- data/app/services/spree/diagnostics/section.rb +72 -0
- data/app/services/spree/diagnostics/sections.rb +121 -0
- data/app/services/spree/diagnostics/stack.rb +73 -0
- data/app/services/spree/diagnostics.rb +132 -0
- data/app/services/spree/imports/row_processors/product_variant.rb +19 -0
- data/app/services/spree/newsletter/subscribe.rb +7 -3
- data/app/services/spree/orders/approve.rb +3 -3
- data/app/services/spree/orders/create_user_account.rb +2 -2
- data/app/services/spree/orders/remove_line_item.rb +16 -5
- data/app/services/spree/product_memberships.rb +21 -1
- data/app/services/spree/product_types/apply_to_products.rb +12 -2
- data/app/services/spree/products/auto_match_collections.rb +20 -4
- data/app/services/spree/products/auto_match_taxons.rb +5 -2
- data/app/services/spree/shipments/update.rb +2 -2
- data/app/services/spree/stock_locations/stock_items/create.rb +5 -2
- data/app/services/spree/stock_reservations/extend.rb +3 -1
- data/app/services/spree/stock_reservations/reserve.rb +12 -7
- data/app/services/spree/store_credits/apply.rb +9 -1
- data/app/services/spree/taxons/add_products.rb +4 -2
- data/app/services/spree/taxons/regenerate_products.rb +5 -2
- data/app/services/spree/taxons/remove_products.rb +4 -2
- data/app/services/spree/update_check.rb +7 -31
- data/app/tools/spree/agent_tools/describe_resource.rb +3 -0
- data/app/tools/spree/agent_tools/get_resource.rb +1 -1
- data/app/tools/spree/agent_tools/resource_write.rb +1 -1
- data/app/tools/spree/agent_tools/search_resources.rb +42 -10
- data/app/workflows/spree/carts/add_item.rb +52 -1
- data/app/workflows/spree/carts/complete.rb +14 -2
- data/app/workflows/spree/carts/recalculate.rb +1 -1
- data/app/workflows/spree/fulfillments/update.rb +1 -1
- data/app/workflows/spree/orders/cancel.rb +3 -1
- data/app/workflows/spree/payments/capture.rb +2 -2
- data/app/workflows/spree/payments/handle_webhook.rb +7 -3
- data/app/workflows/spree/seller_transfers/create.rb +1 -1
- data/app/workflows/spree/sellers/approve.rb +6 -0
- data/app/workflows/spree/sellers/create.rb +5 -2
- data/app/workflows/spree/stock_levels/bulk_upsert.rb +19 -7
- data/config/locales/be.yml +1 -1
- data/config/locales/en.yml +12 -0
- data/config/locales/fr.yml +1 -1
- data/config/locales/lt.yml +1 -1
- data/config/locales/ru.yml +1 -1
- data/config/locales/uk.yml +1 -1
- data/db/migrate/20240303174340_fix_spree_stock_item_unique_index.rb +14 -10
- data/db/migrate/20260710000001_rename_taxons_to_categories.rb +1 -1
- data/db/migrate/20260728000004_rename_shipping_to_fulfillment_and_delivery.rb +1 -1
- data/db/migrate/20260806000001_add_store_id_to_spree_tax_rates_and_categories.rb +1 -1
- data/db/migrate/20260807130001_add_country_state_codes_to_consumers.rb +1 -1
- data/db/migrate/20260809000001_rename_metafields_to_custom_fields.rb +1 -1
- data/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb +1 -1
- data/db/migrate/20260811000001_add_delivery_tracking_to_fulfillments.rb +1 -1
- data/db/migrate/20260814000001_rename_stock_items_to_stock_levels.rb +13 -7
- data/db/migrate/20260824000001_add_store_to_spree_media.rb +1 -1
- data/db/migrate/20260828100001_unify_import_and_export_tenancy.rb +1 -1
- data/db/migrate/20261016000001_remove_default_from_spree_tax_rates_included_in_price.rb +1 -1
- data/lib/spree/agent_tool.rb +3 -3
- data/lib/spree/agent_tools/default_catalog.rb +2 -2
- data/lib/spree/agent_tools/legacy_tools.rb +1 -1
- data/lib/spree/agent_tools/operation_tool.rb +1 -1
- data/lib/spree/agent_tools/record_summary.rb +8 -2
- data/lib/spree/agent_tools/resource_map.rb +82 -7
- data/lib/spree/core/dependencies.rb +10 -10
- data/lib/spree/core/engine.rb +14 -0
- data/lib/spree/core/number_generator.rb +4 -3
- data/lib/spree/core/preferences/preferable.rb +1 -1
- data/lib/spree/core/preferences/preferable_class_methods.rb +5 -1
- data/lib/spree/core/pricing/resolver.rb +2 -2
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/core.rb +48 -10
- data/lib/spree/i18n.rb +6 -2
- data/lib/spree/localized_number.rb +1 -1
- data/lib/spree/removed_apis.rb +274 -0
- data/lib/spree/reporting/default_vocabulary.rb +26 -6
- data/lib/spree/testing_support/factories/digital_asset_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_level_factory.rb +1 -1
- data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
- data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
- data/lib/spree/testing_support/factories/wishlist_item_factory.rb +1 -1
- data/lib/spree/testing_support/i18n.rb +7 -2
- data/lib/spree/testing_support/order_walkthrough.rb +5 -2
- data/lib/spree/upgrades/5_6_to_6_0/manifest.yml +14 -14
- data/lib/tasks/carts_migration.rake +1 -1
- data/lib/tasks/categories_and_collections.rake +1 -1
- data/lib/tasks/deliveries_migration.rake +1 -1
- data/lib/tasks/delivery_method_rules_migration.rake +1 -1
- data/lib/tasks/delivery_migration.rake +1 -1
- data/lib/tasks/delivery_profiles_migration.rake +2 -2
- data/lib/tasks/diagnostics.rake +11 -0
- data/lib/tasks/fold_store_credit_categories.rake +1 -1
- data/lib/tasks/migrate_country_state_codes.rake +1 -1
- data/lib/tasks/migrate_returns.rake +4 -4
- data/lib/tasks/migrate_rich_text_to_columns.rake +1 -1
- data/lib/tasks/store_settings.rake +1 -1
- data/lib/tasks/typed_stock_movements_migration.rake +1 -1
- metadata +13 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d62d8e35b3c55f0a54ef1afb0e8270bfb1391899f12b3959ca6959324953e84d
|
|
4
|
+
data.tar.gz: bd148a4547773fff7263a12765b45f5c2573612190ca06293204a7c25c73d775
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cacd3ad126f55a1cf7ec44ed1d243041bf1617ea3a38a303373995c39a96c9e2b6ab6d7eaf17f11ba4ba0bca7ee63dba8a4b3b3e7185473849afdd6a99afde68
|
|
7
|
+
data.tar.gz: 27d668eb15bc37af05a04143de22cabc308dec4c14d2e63a15b8697d7c97ee3e18eedd82ce7844aeae6528abda210a629839f5fe21e507cd41be861d287b78e5
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
module Imports
|
|
3
|
-
# @deprecated Use {Spree::Imports::ProcessJob}; removed in 6.
|
|
3
|
+
# @deprecated Use {Spree::Imports::ProcessJob}; removed in 6.3.
|
|
4
4
|
class CreateRowsJob < Spree::Imports::BaseJob
|
|
5
5
|
def perform(import_id)
|
|
6
|
-
Spree::Deprecation.warn(
|
|
6
|
+
Spree::Deprecation.warn(
|
|
7
|
+
'Spree::Imports::CreateRowsJob is deprecated and will be removed in Spree 6.3. Use Spree::Imports::ProcessJob instead.'
|
|
8
|
+
)
|
|
7
9
|
Spree::Imports::ProcessJob.perform_now(import_id)
|
|
8
10
|
end
|
|
9
11
|
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
module Imports
|
|
3
3
|
# @deprecated Use {Spree::Imports::ProcessJob} with skip_row_creation:
|
|
4
|
-
# true; removed in 6.
|
|
4
|
+
# true; removed in 6.3.
|
|
5
5
|
class ProcessRowsJob < Spree::Imports::BaseJob
|
|
6
6
|
def perform(import_id)
|
|
7
|
-
Spree::Deprecation.warn(
|
|
7
|
+
Spree::Deprecation.warn(
|
|
8
|
+
'Spree::Imports::ProcessRowsJob is deprecated and will be removed in Spree 6.3. Use Spree::Imports::ProcessJob instead.'
|
|
9
|
+
)
|
|
8
10
|
Spree::Imports::ProcessJob.perform_now(import_id, skip_row_creation: true)
|
|
9
11
|
end
|
|
10
12
|
end
|
|
@@ -7,16 +7,27 @@ module Spree
|
|
|
7
7
|
retry_on ActiveRecord::LockWaitTimeout, wait: 5.seconds, attempts: 3
|
|
8
8
|
discard_on ActiveRecord::RecordNotFound
|
|
9
9
|
|
|
10
|
+
# The gateway got its 200 when this job was enqueued and will not send
|
|
11
|
+
# the webhook again, so a failed settlement (a gateway 5xx, a lock
|
|
12
|
+
# timeout swallowed by the workflow) must be retried here or the
|
|
13
|
+
# buyer is charged without an order. Safe to replay: the workflow
|
|
14
|
+
# skips a payment that is already completed.
|
|
15
|
+
class SettlementFailed < StandardError; end
|
|
16
|
+
|
|
17
|
+
retry_on SettlementFailed, wait: :polynomially_longer, attempts: 5
|
|
18
|
+
|
|
10
19
|
def perform(payment_method_id:, action:, payment_session_id:)
|
|
11
20
|
payment_method = Spree::PaymentMethod.find(payment_method_id)
|
|
12
21
|
Spree::Current.store = payment_method.store
|
|
13
22
|
payment_session = Spree::PaymentSession.find(payment_session_id)
|
|
14
23
|
|
|
15
|
-
Spree.payments_handle_webhook_workflow.call(
|
|
24
|
+
result = Spree.payments_handle_webhook_workflow.call(
|
|
16
25
|
payment_method: payment_method,
|
|
17
26
|
action: action.to_sym,
|
|
18
27
|
payment_session: payment_session
|
|
19
28
|
)
|
|
29
|
+
|
|
30
|
+
raise SettlementFailed, "Payment session #{payment_session.id}: #{result.error}" if result&.failure?
|
|
20
31
|
end
|
|
21
32
|
end
|
|
22
33
|
end
|
|
@@ -2,10 +2,13 @@ module Spree
|
|
|
2
2
|
module Products
|
|
3
3
|
# @deprecated Renamed to AutoMatchCollectionsJob in 6.0 (behavior moved to
|
|
4
4
|
# collections). Subclasses it so jobs enqueued under the old class name still
|
|
5
|
-
# deserialize and run; removed in 6.
|
|
5
|
+
# deserialize and run; removed in 6.3.
|
|
6
6
|
class AutoMatchTaxonsJob < AutoMatchCollectionsJob
|
|
7
7
|
def perform(product_id)
|
|
8
|
-
Spree::Deprecation.warn(
|
|
8
|
+
Spree::Deprecation.warn(
|
|
9
|
+
'Spree::Products::AutoMatchTaxonsJob is deprecated and will be removed in Spree 6.3. ' \
|
|
10
|
+
'Use Spree::Products::AutoMatchCollectionsJob instead.'
|
|
11
|
+
)
|
|
9
12
|
super
|
|
10
13
|
end
|
|
11
14
|
end
|
|
@@ -3,6 +3,14 @@ module Spree
|
|
|
3
3
|
class IndexJob < Spree::BaseJob
|
|
4
4
|
queue_as Spree.queues.search
|
|
5
5
|
|
|
6
|
+
# A bulk write (CSV import, sample data) enqueues thousands of these at
|
|
7
|
+
# once; run in parallel they flood the search service with requests and
|
|
8
|
+
# it answers 429 Too Many Requests. Run one search job per store at a
|
|
9
|
+
# time; the rest wait as blocked executions, so no update is lost. Shared
|
|
10
|
+
# with RemoveJob. The duration only has to outlive one job; expiry lifts
|
|
11
|
+
# the cap, it doesn't drop jobs. Solid Queue only (no-op elsewhere).
|
|
12
|
+
limits_concurrency to: 1, key: ->(*, store_id) { store_id }, group: 'spree_search', duration: 5.minutes if respond_to?(:limits_concurrency)
|
|
13
|
+
|
|
6
14
|
# Search providers are external services (Meilisearch, etc.); a transient 5xx or
|
|
7
15
|
# network blip should not drop the index update.
|
|
8
16
|
retry_on StandardError, wait: :polynomially_longer, attempts: 5
|
|
@@ -3,6 +3,9 @@ module Spree
|
|
|
3
3
|
class RemoveJob < Spree::BaseJob
|
|
4
4
|
queue_as Spree.queues.search
|
|
5
5
|
|
|
6
|
+
# Shares IndexJob's per-store limit, see there.
|
|
7
|
+
limits_concurrency to: 1, key: ->(*, store_id) { store_id }, group: 'spree_search', duration: 5.minutes if respond_to?(:limits_concurrency)
|
|
8
|
+
|
|
6
9
|
# Search providers are external services; broad retry covers network blips and 5xx.
|
|
7
10
|
retry_on StandardError, wait: :polynomially_longer, attempts: 5
|
|
8
11
|
# Must come after `retry_on StandardError` so DeserializationError lands in discard
|
|
@@ -3,10 +3,13 @@ module Spree
|
|
|
3
3
|
module StockItems
|
|
4
4
|
# @deprecated Renamed to Spree::StockLocations::StockLevels::CreateJob in 6.0.
|
|
5
5
|
# Subclasses it so jobs enqueued under the old class name before the deploy
|
|
6
|
-
# still deserialize and run; removed in 6.
|
|
6
|
+
# still deserialize and run; removed in 6.3.
|
|
7
7
|
class CreateJob < StockLevels::CreateJob
|
|
8
8
|
def perform(*args)
|
|
9
|
-
Spree::Deprecation.warn(
|
|
9
|
+
Spree::Deprecation.warn(
|
|
10
|
+
'Spree::StockLocations::StockItems::CreateJob is deprecated and will be removed in Spree 6.3. ' \
|
|
11
|
+
'Use Spree::StockLocations::StockLevels::CreateJob instead.'
|
|
12
|
+
)
|
|
10
13
|
super
|
|
11
14
|
end
|
|
12
15
|
end
|
|
@@ -29,7 +29,7 @@ module Spree
|
|
|
29
29
|
@_store_locale_active = true
|
|
30
30
|
begin
|
|
31
31
|
Spree::Locales::SetFallbackLocaleForStore.new.call(store: store) if store
|
|
32
|
-
I18n.with_locale(locale, &block)
|
|
32
|
+
Spree::Current.with_content_locale(store&.default_market&.default_locale) { I18n.with_locale(locale, &block) }
|
|
33
33
|
ensure
|
|
34
34
|
@_store_locale_active = previously_active
|
|
35
35
|
Mobility.store_based_fallbacks = previous_fallbacks
|
|
@@ -178,7 +178,7 @@ module Spree
|
|
|
178
178
|
# Prepended rather than defined outright, so `super` reaches the
|
|
179
179
|
# generated reader.
|
|
180
180
|
#
|
|
181
|
-
# Removed in 6.
|
|
181
|
+
# Removed in 6.3, once the backfill is a release behind.
|
|
182
182
|
def define_transitional_actor_reader(name)
|
|
183
183
|
transitional_actor_readers.module_eval do
|
|
184
184
|
define_method(name) do
|
|
@@ -188,7 +188,7 @@ module Spree
|
|
|
188
188
|
Spree::Deprecation.warn(
|
|
189
189
|
"#{self.class.name}##{name} resolved through #{Spree.admin_user_class} because " \
|
|
190
190
|
"#{name}_type is blank. Run `rake spree:upgrade:backfill_actor_types`; the fallback " \
|
|
191
|
-
'is removed in Spree 6.
|
|
191
|
+
'is removed in Spree 6.3.'
|
|
192
192
|
)
|
|
193
193
|
|
|
194
194
|
# Fill the type across the whole lazily-preloaded group, not just
|
|
@@ -295,14 +295,14 @@ module Spree
|
|
|
295
295
|
# @deprecated Carts are {Spree::Cart} since 6.0, so an incomplete order is
|
|
296
296
|
# a backoffice draft rather than the customer's cart. Use
|
|
297
297
|
# +carts.where(store: store)+ for carts, or +orders.drafts+ for drafts.
|
|
298
|
-
# Removed in Spree 6.
|
|
298
|
+
# Removed in Spree 6.3.
|
|
299
299
|
# @param [Spree::Store] store
|
|
300
300
|
# @param [Hash] options
|
|
301
301
|
# @option options [Array<Symbol>] :includes
|
|
302
302
|
# @return [Spree::Order]
|
|
303
303
|
def last_incomplete_spree_order(store, options = {})
|
|
304
304
|
Spree::Deprecation.warn(
|
|
305
|
-
'Spree::CustomerMethods#last_incomplete_spree_order is deprecated and will be removed in Spree 6.
|
|
305
|
+
'Spree::CustomerMethods#last_incomplete_spree_order is deprecated and will be removed in Spree 6.3. ' \
|
|
306
306
|
'Carts are Spree::Cart since 6.0 and this returns draft orders; use #carts for the customer\'s carts.'
|
|
307
307
|
)
|
|
308
308
|
|
|
@@ -393,9 +393,11 @@ module Spree
|
|
|
393
393
|
# every column carrying personal data rather than three on this row —
|
|
394
394
|
# the address book, the address snapshots on past orders, gateway
|
|
395
395
|
# profiles, OAuth identities and live sessions all outlived this method.
|
|
396
|
-
# Removed in Spree 6.
|
|
396
|
+
# Removed in Spree 6.3.
|
|
397
397
|
def scramble_email_and_names
|
|
398
|
-
Spree::Deprecation.warn(
|
|
398
|
+
Spree::Deprecation.warn(
|
|
399
|
+
'Spree::CustomerMethods#scramble_email_and_names is deprecated and will be removed in Spree 6.3. Use Spree::Customers::Anonymize instead.'
|
|
400
|
+
)
|
|
399
401
|
|
|
400
402
|
Spree.customer_anonymize_workflow.call(customer: self, store: Spree::Current.store).success?
|
|
401
403
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
# Deprecation shim for the 6.0 user_id -> customer_id / belongs_to :user -> :customer
|
|
3
3
|
# rename. Included by customer-facing models so `.user` / `.user_id` keep working
|
|
4
|
-
#
|
|
4
|
+
# until Spree 6.3.
|
|
5
5
|
module DeprecatedCustomerAlias
|
|
6
6
|
extend ActiveSupport::Concern
|
|
7
7
|
|
|
@@ -10,12 +10,20 @@ module Spree
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def user
|
|
13
|
-
|
|
13
|
+
if defined?(Spree::Deprecation)
|
|
14
|
+
Spree::Deprecation.warn(
|
|
15
|
+
"#{self.class}#user is deprecated and will be removed in Spree 6.3. Use #customer instead."
|
|
16
|
+
)
|
|
17
|
+
end
|
|
14
18
|
customer
|
|
15
19
|
end
|
|
16
20
|
|
|
17
21
|
def user=(value)
|
|
18
|
-
|
|
22
|
+
if defined?(Spree::Deprecation)
|
|
23
|
+
Spree::Deprecation.warn(
|
|
24
|
+
"#{self.class}#user= is deprecated and will be removed in Spree 6.3. Use #customer= instead."
|
|
25
|
+
)
|
|
26
|
+
end
|
|
19
27
|
self.customer = value
|
|
20
28
|
end
|
|
21
29
|
end
|
|
@@ -11,7 +11,7 @@ module Spree
|
|
|
11
11
|
#
|
|
12
12
|
# Rows created before 6.0 keep their stored number, so gateway references
|
|
13
13
|
# and packing slips already in the wild still resolve. New rows never write
|
|
14
|
-
# the column — it is frozen legacy data awaiting the 6.
|
|
14
|
+
# the column — it is frozen legacy data awaiting the 6.3 drop.
|
|
15
15
|
module DerivedNumber
|
|
16
16
|
extend ActiveSupport::Concern
|
|
17
17
|
|
|
@@ -22,28 +22,33 @@ module Spree
|
|
|
22
22
|
[namespace, key]
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
# Deprecated 6.0 names, removed in 6.
|
|
25
|
+
# Deprecated 6.0 names, removed in 6.3.
|
|
26
26
|
def ensure_metafield_definition_exists!(key_with_namespace, store: Spree::Current.store)
|
|
27
|
-
Spree::Deprecation.warn(
|
|
27
|
+
Spree::Deprecation.warn(
|
|
28
|
+
'ensure_metafield_definition_exists! is deprecated and will be removed in Spree 6.3. Use ensure_custom_field_definition_exists! instead.'
|
|
29
|
+
)
|
|
28
30
|
ensure_custom_field_definition_exists!(key_with_namespace, store: store)
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
def with_metafield_key(key_with_namespace)
|
|
32
|
-
Spree::Deprecation.warn('.with_metafield_key is deprecated and will be removed in Spree 6.
|
|
34
|
+
Spree::Deprecation.warn('.with_metafield_key is deprecated and will be removed in Spree 6.3. Use .with_custom_field_key instead.')
|
|
33
35
|
with_custom_field_key(key_with_namespace)
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
def with_metafield_key_value(key_with_namespace, value)
|
|
37
|
-
Spree::Deprecation.warn('.with_metafield_key_value is deprecated and will be removed in Spree 6.
|
|
39
|
+
Spree::Deprecation.warn('.with_metafield_key_value is deprecated and will be removed in Spree 6.3. Use .with_custom_field_key_value instead.')
|
|
38
40
|
with_custom_field_key_value(key_with_namespace, value)
|
|
39
41
|
end
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
included do
|
|
43
|
-
|
|
45
|
+
# The explicit inverse lets a custom field built on an unsaved owner find that owner when
|
|
46
|
+
# it is saved. Rails cannot infer it for a scoped association, so without it the row is
|
|
47
|
+
# inserted with a NULL resource_id unless the app happens to enable `has_many_inversing`.
|
|
48
|
+
has_many :custom_fields, -> { includes(:custom_field_definition) }, as: :resource, inverse_of: :resource, class_name: 'Spree::CustomField', dependent: :destroy
|
|
44
49
|
has_many :storefront_custom_fields, -> { includes(:custom_field_definition).storefront_visible }, as: :resource, class_name: 'Spree::CustomField'
|
|
45
50
|
|
|
46
|
-
# Deprecated 6.0 association names, removed in 6.
|
|
51
|
+
# Deprecated 6.0 association names, removed in 6.3. `private_metafields`
|
|
47
52
|
# has no replacement — read `custom_fields` and filter, or query
|
|
48
53
|
# Spree::CustomField.admin_only directly.
|
|
49
54
|
has_many :metafields, -> { includes(:custom_field_definition) }, as: :resource, class_name: 'Spree::CustomField', deprecated: true
|
|
@@ -167,26 +172,26 @@ module Spree
|
|
|
167
172
|
custom_fields.with_key(namespace, key).exists?
|
|
168
173
|
end
|
|
169
174
|
|
|
170
|
-
# Deprecated 6.0 names, removed in 6.
|
|
175
|
+
# Deprecated 6.0 names, removed in 6.3.
|
|
171
176
|
def set_metafield(definition_or_key, value)
|
|
172
|
-
Spree::Deprecation.warn('#set_metafield is deprecated and will be removed in Spree 6.
|
|
177
|
+
Spree::Deprecation.warn('#set_metafield is deprecated and will be removed in Spree 6.3. Use #set_custom_field instead.')
|
|
173
178
|
set_custom_field(definition_or_key, value)
|
|
174
179
|
end
|
|
175
180
|
|
|
176
181
|
def get_metafield(key_with_namespace)
|
|
177
|
-
Spree::Deprecation.warn('#get_metafield is deprecated and will be removed in Spree 6.
|
|
182
|
+
Spree::Deprecation.warn('#get_metafield is deprecated and will be removed in Spree 6.3. Use #get_custom_field instead.')
|
|
178
183
|
get_custom_field(key_with_namespace)
|
|
179
184
|
end
|
|
180
185
|
|
|
181
186
|
def has_metafield?(key_with_namespace)
|
|
182
|
-
Spree::Deprecation.warn('#has_metafield? is deprecated and will be removed in Spree 6.
|
|
187
|
+
Spree::Deprecation.warn('#has_metafield? is deprecated and will be removed in Spree 6.3. Use #has_custom_field? instead.')
|
|
183
188
|
has_custom_field?(key_with_namespace)
|
|
184
189
|
end
|
|
185
190
|
|
|
186
191
|
# Legacy payloads key the definition as `metafield_definition_id`, which
|
|
187
192
|
# the new writer rejects — translate rather than silently dropping them.
|
|
188
193
|
def metafields_attributes=(attributes)
|
|
189
|
-
Spree::Deprecation.warn('#metafields_attributes= is deprecated and will be removed in Spree 6.
|
|
194
|
+
Spree::Deprecation.warn('#metafields_attributes= is deprecated and will be removed in Spree 6.3. Use #custom_fields_attributes= instead.')
|
|
190
195
|
|
|
191
196
|
attributes = attributes.values if attributes.is_a?(Hash)
|
|
192
197
|
translated = attributes.map do |attrs|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Spree
|
|
2
|
-
# @deprecated Use {Spree::Current.integrations}; removed in Spree 6.
|
|
2
|
+
# @deprecated Use {Spree::Current.integrations}; removed in Spree 6.3.
|
|
3
3
|
#
|
|
4
4
|
# Nothing in Spree calls these — the per-request integration set lives on
|
|
5
5
|
# {Spree::Current} — but the concern sits on Spree::Base, so every model has
|
|
@@ -7,7 +7,8 @@ module Spree
|
|
|
7
7
|
module IntegrationsConcern
|
|
8
8
|
def store_integrations
|
|
9
9
|
Spree::Deprecation.warn(
|
|
10
|
-
'Spree::IntegrationsConcern#store_integrations is deprecated and will be removed in Spree 6.
|
|
10
|
+
'Spree::IntegrationsConcern#store_integrations is deprecated and will be removed in Spree 6.3. ' \
|
|
11
|
+
'Use Spree::Current.integrations instead.'
|
|
11
12
|
)
|
|
12
13
|
|
|
13
14
|
Spree::Current.integrations
|
|
@@ -15,7 +16,8 @@ module Spree
|
|
|
15
16
|
|
|
16
17
|
def store_integration(name)
|
|
17
18
|
Spree::Deprecation.warn(
|
|
18
|
-
'Spree::IntegrationsConcern#store_integration is deprecated and will be removed in Spree 6.
|
|
19
|
+
'Spree::IntegrationsConcern#store_integration is deprecated and will be removed in Spree 6.3. ' \
|
|
20
|
+
'Use Spree::Current.integrations.find { |integration| integration.type.to_s.demodulize.underscore == name } instead.'
|
|
19
21
|
)
|
|
20
22
|
|
|
21
23
|
Spree::Current.integrations.find { |integration| integration.type.to_s.demodulize.underscore == name }
|
|
@@ -16,7 +16,7 @@ module Spree
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
# @deprecated The column is +label+ since 6.0; removed in 6.
|
|
19
|
+
# @deprecated The column is +label+ since 6.0; removed in 6.3.
|
|
20
20
|
#
|
|
21
21
|
# Unlike the attribute aliases the other 6.0 renames use, this is a plain
|
|
22
22
|
# method — Mobility owns +label+, so it cannot be an alias_attribute. It
|
|
@@ -24,13 +24,13 @@ module Spree
|
|
|
24
24
|
# and +find_by(presentation:)+ name a column that no longer exists and
|
|
25
25
|
# raise. Query by +label+.
|
|
26
26
|
def presentation(*args, **kwargs)
|
|
27
|
-
Spree::Deprecation.warn("#{self.class.name}#presentation is deprecated and will be removed in Spree 6.
|
|
27
|
+
Spree::Deprecation.warn("#{self.class.name}#presentation is deprecated and will be removed in Spree 6.3. Use #label instead.")
|
|
28
28
|
label(*args, **kwargs)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
# @deprecated See {#presentation}; removed in 6.
|
|
31
|
+
# @deprecated See {#presentation}; removed in 6.3.
|
|
32
32
|
def presentation=(value)
|
|
33
|
-
Spree::Deprecation.warn("#{self.class.name}#presentation= is deprecated and will be removed in Spree 6.
|
|
33
|
+
Spree::Deprecation.warn("#{self.class.name}#presentation= is deprecated and will be removed in Spree 6.3. Use #label= instead.")
|
|
34
34
|
self.label = value
|
|
35
35
|
end
|
|
36
36
|
end
|
|
@@ -11,7 +11,7 @@ module Spree
|
|
|
11
11
|
serialize :metadata, coder: HashSerializer
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# Deprecated alias for the renamed `metadata` column. Removed in Spree 6.
|
|
14
|
+
# Deprecated alias for the renamed `metadata` column. Removed in Spree 6.3.
|
|
15
15
|
#
|
|
16
16
|
# Only the reader and writer are bridged. The column is gone, so the attribute
|
|
17
17
|
# methods Active Record generated alongside it — `private_metadata?`,
|
|
@@ -19,12 +19,12 @@ module Spree
|
|
|
19
19
|
# `private_metadata_before_type_cast` and the rest of the dirty-tracking family
|
|
20
20
|
# — no longer exist and raise NoMethodError. Call the `metadata` equivalents.
|
|
21
21
|
def private_metadata
|
|
22
|
-
Spree::Deprecation.warn('private_metadata is deprecated and will be removed in Spree 6.
|
|
22
|
+
Spree::Deprecation.warn('private_metadata is deprecated and will be removed in Spree 6.3. Use metadata instead.')
|
|
23
23
|
metadata
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def private_metadata=(value)
|
|
27
|
-
Spree::Deprecation.warn('private_metadata= is deprecated and will be removed in Spree 6.
|
|
27
|
+
Spree::Deprecation.warn('private_metadata= is deprecated and will be removed in Spree 6.3. Use metadata= instead.')
|
|
28
28
|
self.metadata = value
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -90,11 +90,15 @@ module Spree
|
|
|
90
90
|
|
|
91
91
|
# Rows of `model` whose `email` is this address, whatever its casing.
|
|
92
92
|
#
|
|
93
|
+
# The exact match goes through the model, so a table whose email the app
|
|
94
|
+
# encrypts is still matched: SQL only ever sees its ciphertext.
|
|
95
|
+
#
|
|
93
96
|
# @param model [Class]
|
|
94
97
|
# @param email [String]
|
|
95
98
|
# @return [ActiveRecord::Relation]
|
|
96
99
|
def with_email(model, email)
|
|
97
|
-
model.where(
|
|
100
|
+
model.where(email: email.to_s).
|
|
101
|
+
or(model.where(model.arel_table[:email].lower.eq(email.to_s.downcase)))
|
|
98
102
|
end
|
|
99
103
|
|
|
100
104
|
# Rows at this address that no *other* person already owns.
|
|
@@ -241,8 +241,8 @@ module Spree
|
|
|
241
241
|
# (docs/plans/6.0-volume-pricing.md).
|
|
242
242
|
def self.with_currency(currency)
|
|
243
243
|
joins(variants: :prices).
|
|
244
|
-
where(Price.table_name => { currency: currency.upcase
|
|
245
|
-
|
|
244
|
+
where(Price.table_name => { currency: currency.upcase }).
|
|
245
|
+
merge(Price.listing).
|
|
246
246
|
distinct
|
|
247
247
|
end
|
|
248
248
|
|
|
@@ -207,8 +207,9 @@ module Spree
|
|
|
207
207
|
return unless Spree::Events.enabled?
|
|
208
208
|
|
|
209
209
|
@_current_event_name = event_name
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
publish_in_event_store do
|
|
211
|
+
Spree::Events.publish(event_name, payload || event_payload_for(event_name), metadata)
|
|
212
|
+
end
|
|
212
213
|
ensure
|
|
213
214
|
@_current_event_name = nil
|
|
214
215
|
end
|
|
@@ -389,7 +390,29 @@ module Spree
|
|
|
389
390
|
end
|
|
390
391
|
|
|
391
392
|
def capture_pre_destroy_payload
|
|
392
|
-
@_pre_destroy_payload = event_payload
|
|
393
|
+
@_pre_destroy_payload = in_event_store { event_payload }
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# Publishes with the record's own store, so the event is
|
|
397
|
+
# attributed to it rather than to whatever store the caller happens to
|
|
398
|
+
# be in — the default store, in a job or a rake task.
|
|
399
|
+
#
|
|
400
|
+
# Spree::Event reads Spree::Current lazily, so store_id is settled here
|
|
401
|
+
# while the context is still open: a subscriber job or a webhook
|
|
402
|
+
# delivery reads it long after.
|
|
403
|
+
def publish_in_event_store
|
|
404
|
+
in_event_store do
|
|
405
|
+
published = yield
|
|
406
|
+
published.store_id if published.is_a?(Spree::Event)
|
|
407
|
+
published
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
def in_event_store(&block)
|
|
412
|
+
store = (respond_to?(:store) ? self.store : nil) || Spree::Current.store
|
|
413
|
+
return block.call if store.nil? || store == Spree::Current.store
|
|
414
|
+
|
|
415
|
+
Spree::Current.with_store(store, &block)
|
|
393
416
|
end
|
|
394
417
|
end
|
|
395
418
|
end
|
|
@@ -7,7 +7,7 @@ module Spree
|
|
|
7
7
|
# of checkout addresses to the customer's defaults, and the ship→bill cloning
|
|
8
8
|
# predicate. The shipping address is canonical: use_shipping copies it
|
|
9
9
|
# onto the billing address; the reverse use_billing direction is a
|
|
10
|
-
# deprecated 6.
|
|
10
|
+
# deprecated 6.3-removal bridge. Clone callbacks are wired per model.
|
|
11
11
|
module Addresses
|
|
12
12
|
extend ActiveSupport::Concern
|
|
13
13
|
|
|
@@ -85,13 +85,16 @@ module Spree
|
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
# @deprecated The shipping address is canonical — use +use_shipping+ to
|
|
88
|
-
# copy it onto the billing address. Removed in 6.
|
|
88
|
+
# copy it onto the billing address. Removed in 6.3.
|
|
89
89
|
def use_billing=(value)
|
|
90
|
-
Spree::Deprecation.warn(
|
|
90
|
+
Spree::Deprecation.warn(
|
|
91
|
+
'use_billing is deprecated and will be removed in Spree 6.3. ' \
|
|
92
|
+
'The shipping address comes first — use use_shipping to copy it onto the billing address.'
|
|
93
|
+
)
|
|
91
94
|
@use_billing = value
|
|
92
95
|
end
|
|
93
96
|
|
|
94
|
-
# @deprecated See {#use_billing=}; removed in 6.
|
|
97
|
+
# @deprecated See {#use_billing=}; removed in 6.3.
|
|
95
98
|
# @return [Boolean]
|
|
96
99
|
def use_billing?
|
|
97
100
|
use_billing.in?([true, 'true', '1'])
|
|
@@ -194,7 +197,7 @@ module Spree
|
|
|
194
197
|
# customer's default ship address.
|
|
195
198
|
#
|
|
196
199
|
# @deprecated The shipping address is canonical (see {#use_billing=});
|
|
197
|
-
# removed in 6.
|
|
200
|
+
# removed in 6.3 together with the use_billing bridge.
|
|
198
201
|
# @return [true]
|
|
199
202
|
def clone_billing_address
|
|
200
203
|
self.ship_address = bill_address if bill_address
|
|
@@ -4,7 +4,7 @@ module Spree
|
|
|
4
4
|
# {Spree::Cart} and {Spree::Order}. Before 6.0 a cart was an incomplete
|
|
5
5
|
# order, so extensions written against 5.x (payment gateways, checkout
|
|
6
6
|
# plugins) call the legacy names on carts too. Every legacy name warns and
|
|
7
|
-
# forwards to its replacement. Removed in 6.
|
|
7
|
+
# forwards to its replacement. Removed in 6.3.
|
|
8
8
|
#
|
|
9
9
|
# Renamed columns are also registered with +alias_attribute+, so the legacy
|
|
10
10
|
# name keeps working in +where+ / +find_by+ (those paths do not warn).
|
|
@@ -80,7 +80,7 @@ module Spree
|
|
|
80
80
|
private
|
|
81
81
|
|
|
82
82
|
def warn_deprecated_name(legacy_name, current_name)
|
|
83
|
-
Spree::Deprecation.warn("#{self.class.name}##{legacy_name} is deprecated and will be removed in Spree 6.
|
|
83
|
+
Spree::Deprecation.warn("#{self.class.name}##{legacy_name} is deprecated and will be removed in Spree 6.3. Use ##{current_name} instead.")
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
end
|
|
@@ -34,9 +34,11 @@ module Spree
|
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
# @deprecated Use +default_country_code+. Removed in 6.
|
|
37
|
+
# @deprecated Use +default_country_code+. Removed in 6.3.
|
|
38
38
|
def default_country_iso_code
|
|
39
|
-
Spree::Deprecation.warn(
|
|
39
|
+
Spree::Deprecation.warn(
|
|
40
|
+
'Spree::Store#default_country_iso_code is deprecated and will be removed in Spree 6.3. Use #default_country_code instead.'
|
|
41
|
+
)
|
|
40
42
|
default_country_code
|
|
41
43
|
end
|
|
42
44
|
|
|
@@ -31,9 +31,12 @@ module Spree
|
|
|
31
31
|
# it accepts to the customer's defaults on its own (see
|
|
32
32
|
# Spree::Purchase::Addresses), and a guest who registers after placing
|
|
33
33
|
# an order has that order's addresses adopted by Spree::Customers::Create.
|
|
34
|
-
# Removed in Spree 6.
|
|
34
|
+
# Removed in Spree 6.3.
|
|
35
35
|
def persist_order_address(order)
|
|
36
|
-
Spree::Deprecation.warn(
|
|
36
|
+
Spree::Deprecation.warn(
|
|
37
|
+
'Spree::UserAddress#persist_order_address is deprecated and will be removed in Spree 6.3. ' \
|
|
38
|
+
"Checkout already promotes the addresses it accepts to the customer's defaults."
|
|
39
|
+
)
|
|
37
40
|
|
|
38
41
|
# FIXME: we should check if the User's address is associated with country accepted by Store
|
|
39
42
|
# if not we should try to find an address with valid country in User's address book
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
# Deprecation alias for Spree::CustomerMethods, renamed from Spree::UserMethods in 6.0.
|
|
3
3
|
# True constant alias — the underlying module, its associations, and prefix (cust)
|
|
4
|
-
# are all Spree::CustomerMethods. Remove in Spree 6.
|
|
4
|
+
# are all Spree::CustomerMethods. Remove in Spree 6.3.
|
|
5
5
|
UserMethods = CustomerMethods
|
|
6
|
-
Spree::Deprecation.warn('Spree::UserMethods is deprecated and will be removed in Spree 6.
|
|
6
|
+
Spree::Deprecation.warn('Spree::UserMethods is deprecated and will be removed in Spree 6.3. Use Spree::CustomerMethods instead.')
|
|
7
7
|
end
|