spree_core 5.4.0.beta → 5.4.0.beta2
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/finders/spree/products/find.rb +1 -28
- data/app/helpers/spree/base_helper.rb +1 -54
- data/app/mailers/spree/base_mailer.rb +4 -3
- data/app/models/concerns/spree/adjustment_source.rb +0 -8
- data/app/models/concerns/spree/admin_user_methods.rb +0 -2
- data/app/models/concerns/spree/image_methods.rb +4 -0
- data/app/models/concerns/spree/metadata.rb +10 -0
- data/app/models/concerns/spree/product_scopes.rb +2 -47
- data/app/models/concerns/spree/stores/markets.rb +7 -7
- data/app/models/concerns/spree/vat_price_calculation.rb +2 -2
- data/app/models/spree/ability.rb +5 -5
- data/app/models/spree/address.rb +3 -2
- data/app/models/spree/adjustable/promotion_accumulator.rb +1 -1
- data/app/models/spree/adjustment.rb +1 -20
- data/app/models/spree/api_key.rb +57 -2
- data/app/models/spree/country.rb +7 -3
- data/app/models/spree/credit_card.rb +0 -27
- data/app/models/spree/current.rb +38 -2
- data/app/models/spree/exports/products.rb +0 -6
- data/app/models/spree/gateway/bogus.rb +9 -9
- data/app/models/spree/gateway.rb +0 -3
- data/app/models/spree/gift_card_batch.rb +4 -0
- data/app/models/spree/image/configuration/active_storage.rb +0 -2
- data/app/models/spree/image.rb +7 -31
- data/app/models/spree/log_entry.rb +8 -5
- data/app/models/spree/order/checkout.rb +0 -18
- data/app/models/spree/order.rb +20 -11
- data/app/models/spree/payment/gateway_options.rb +2 -2
- data/app/models/spree/payment/processing.rb +5 -5
- data/app/models/spree/payment.rb +1 -1
- data/app/models/spree/payment_connection_error.rb +3 -0
- data/app/models/spree/payment_method/check.rb +1 -1
- data/app/models/spree/payment_method/store_credit.rb +5 -5
- data/app/models/spree/payment_response.rb +70 -0
- data/app/models/spree/permission_sets/default_customer.rb +0 -5
- data/app/models/spree/permission_sets/product_display.rb +0 -2
- data/app/models/spree/permission_sets/product_management.rb +0 -2
- data/app/models/spree/product.rb +4 -72
- data/app/models/spree/promotion.rb +2 -14
- data/app/models/spree/promotion_handler/coupon.rb +3 -3
- data/app/models/spree/prototype.rb +0 -3
- data/app/models/spree/refund.rb +6 -2
- data/app/models/spree/shipment/emails.rb +1 -0
- data/app/models/spree/shipping_category.rb +3 -3
- data/app/models/spree/store.rb +10 -49
- data/app/models/spree/store_credit.rb +4 -0
- data/app/models/spree/tax_category.rb +1 -11
- data/app/models/spree/taxon.rb +0 -16
- data/app/models/spree/variant.rb +2 -40
- data/app/models/spree/zone.rb +1 -4
- data/app/services/spree/cart/add_item.rb +8 -4
- data/app/services/spree/cart/create.rb +13 -2
- data/app/services/spree/products/duplicator.rb +0 -12
- data/app/services/spree/products/prepare_nested_attributes.rb +0 -12
- data/config/locales/en.yml +3 -20
- data/db/migrate/20210914000000_spree_four_three.rb +0 -38
- data/db/migrate/20210915064329_add_metadata_to_spree_multiple_tables.rb +0 -1
- data/db/migrate/20260226000000_add_locale_to_spree_orders.rb +5 -0
- data/db/migrate/20260226100000_add_token_digest_to_spree_api_keys.rb +21 -0
- data/lib/generators/spree/cursor_rules/templates/spree_rules.mdc +1 -3
- data/lib/spree/core/configuration.rb +0 -3
- data/lib/spree/core/controller_helpers/strong_parameters.rb +1 -2
- data/lib/spree/core/dependencies.rb +2 -10
- data/lib/spree/core/engine.rb +0 -13
- data/lib/spree/core/pricing/resolver.rb +1 -9
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/core.rb +10 -25
- data/lib/spree/permitted_attributes.rb +2 -14
- data/lib/spree/testing_support/factories/order_factory.rb +1 -0
- data/lib/spree/testing_support/factories/payment_method_factory.rb +1 -6
- data/lib/spree/testing_support/factories/product_factory.rb +0 -7
- data/lib/spree/testing_support/factories/prototype_factory.rb +0 -2
- data/lib/tasks/core.rake +0 -265
- metadata +8 -101
- data/app/finders/spree/posts/find.rb +0 -137
- data/app/finders/spree/product_properties/find_available.rb +0 -20
- data/app/helpers/spree/mail_helper.rb +0 -27
- data/app/jobs/spree/api_key_touch_job.rb +0 -9
- data/app/mailers/spree/test_mailer.rb +0 -8
- data/app/models/action_text/video_embed.rb +0 -13
- data/app/models/concerns/spree/has_one_link.rb +0 -42
- data/app/models/concerns/spree/linkable.rb +0 -9
- data/app/models/concerns/spree/previewable.rb +0 -17
- data/app/models/spree/data_feed/google.rb +0 -15
- data/app/models/spree/data_feed.rb +0 -42
- data/app/models/spree/gateway/bogus_simple.rb +0 -24
- data/app/models/spree/post.rb +0 -108
- data/app/models/spree/post_category.rb +0 -46
- data/app/models/spree/product_property.rb +0 -51
- data/app/models/spree/property.rb +0 -86
- data/app/models/spree/property_prototype.rb +0 -9
- data/app/models/spree/store_favicon_image.rb +0 -20
- data/app/models/spree/store_logo.rb +0 -4
- data/app/models/spree/store_mailer_logo.rb +0 -7
- data/app/models/spree/taxon_image/configuration/active_storage.rb +0 -26
- data/app/models/spree/taxon_image.rb +0 -28
- data/app/presenters/spree/filters/properties_presenter.rb +0 -23
- data/app/presenters/spree/filters/property_presenter.rb +0 -42
- data/app/services/spree/data_feeds/google/optional_attributes.rb +0 -23
- data/app/services/spree/data_feeds/google/optional_sub_attributes.rb +0 -21
- data/app/services/spree/data_feeds/google/products_list.rb +0 -14
- data/app/services/spree/data_feeds/google/required_attributes.rb +0 -68
- data/app/services/spree/data_feeds/google/rss.rb +0 -109
- data/app/sorters/spree/posts/sort.rb +0 -40
- data/app/views/action_text/video_embeds/_thumbnail.html.erb +0 -1
- data/app/views/action_text/video_embeds/_video_embed.html.erb +0 -3
- data/app/views/layouts/action_text/contents/_content.html.erb +0 -3
- data/app/views/spree/test_mailer/test_email.html.erb +0 -40
- data/app/views/spree/test_mailer/test_email.text.erb +0 -4
- data/config/initializers/oembed.rb +0 -1
- data/db/migrate/20221229132350_create_spree_data_feed_settings.rb +0 -14
- data/db/migrate/20230109084253_create_product_property_translations.rb +0 -24
- data/db/migrate/20230109105943_create_property_translations.rb +0 -24
- data/db/migrate/20230415155958_rename_data_feed_settings_table.rb +0 -5
- data/db/migrate/20230415160828_rename_data_feed_table_columns.rb +0 -7
- data/db/migrate/20230415161226_add_indexes_to_data_feeds_table.rb +0 -5
- data/db/migrate/20230512094803_rename_data_feeds_column_provider_to_type.rb +0 -5
- data/db/migrate/20240914153106_add_display_on_to_spree_properties.rb +0 -5
- data/db/migrate/20240915144935_add_position_to_spree_properties.rb +0 -6
- data/db/migrate/20250121160028_create_spree_posts_and_spree_post_categories.rb +0 -33
- data/db/migrate/20250127083740_add_kind_to_spree_properties.rb +0 -5
- data/db/migrate/20250217171018_create_action_text_video_embeds.rb +0 -11
- data/db/migrate/20250305121657_remove_spree_posts_indices.rb +0 -7
- data/db/migrate/20250730154601_add_unique_index_on_spree_properties_name.rb +0 -24
- data/db/sample_data/posts.rb +0 -7
- data/lib/spree/core/controller_helpers/search.rb +0 -17
- data/lib/spree/core/product_filters.rb +0 -218
- data/lib/spree/core/query_filters/comparable.rb +0 -50
- data/lib/spree/core/query_filters/date.rb +0 -8
- data/lib/spree/core/query_filters/number.rb +0 -8
- data/lib/spree/core/query_filters/text.rb +0 -36
- data/lib/spree/core/query_filters.rb +0 -11
- data/lib/spree/core/search/base.rb +0 -144
- data/lib/spree/testing_support/factories/favicon_image_factory.rb +0 -9
- data/lib/spree/testing_support/factories/google_data_feed_factory.rb +0 -7
- data/lib/spree/testing_support/factories/post_category_factory.rb +0 -7
- data/lib/spree/testing_support/factories/post_factory.rb +0 -22
- data/lib/spree/testing_support/factories/product_property_factory.rb +0 -7
- data/lib/spree/testing_support/factories/property_factory.rb +0 -28
- data/lib/spree/testing_support/factories/taxon_image_factory.rb +0 -9
- data/lib/spree/testing_support/flash.rb +0 -25
- data/lib/spree/testing_support/flatpickr_capybara.rb +0 -124
- data/lib/tasks/exchanges.rake +0 -66
data/config/locales/en.yml
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
en:
|
|
3
|
-
action_text:
|
|
4
|
-
video_embed:
|
|
5
|
-
not_found: Can't embed a video using the provided URL
|
|
6
3
|
activemodel:
|
|
7
4
|
errors:
|
|
8
5
|
messages:
|
|
@@ -737,8 +734,6 @@ en:
|
|
|
737
734
|
all_adjustments_opened: All adjustments successfully opened!
|
|
738
735
|
all_departments: All departments
|
|
739
736
|
all_items_have_been_returned: All items have been returned
|
|
740
|
-
all_posts: All posts
|
|
741
|
-
all_posts_with_tag: All posts with tag
|
|
742
737
|
all_products: All products
|
|
743
738
|
all_rights_reserved: All rights reserved
|
|
744
739
|
all_time: All time
|
|
@@ -805,8 +800,6 @@ en:
|
|
|
805
800
|
bill_address: Bill Address
|
|
806
801
|
billing: Billing
|
|
807
802
|
billing_address: Billing Address
|
|
808
|
-
blog: Blog
|
|
809
|
-
blogs_posts: Blogs posts
|
|
810
803
|
body_tag_end: Body tag end
|
|
811
804
|
body_tag_start: Body tag start
|
|
812
805
|
both: Both
|
|
@@ -1000,10 +993,6 @@ en:
|
|
|
1000
993
|
default_country_help: Country that will be used for the default shipping and billing addresses on Checkout
|
|
1001
994
|
default_currency: Default currency
|
|
1002
995
|
default_locale: Default locale
|
|
1003
|
-
default_post_categories:
|
|
1004
|
-
articles: Articles
|
|
1005
|
-
news: News
|
|
1006
|
-
resources: Resources
|
|
1007
996
|
default_refund_amount: Default Refund Amount
|
|
1008
997
|
default_shipping_address: Default shipping address
|
|
1009
998
|
default_stock_location_name: Shop location
|
|
@@ -1334,7 +1323,9 @@ en:
|
|
|
1334
1323
|
list: List
|
|
1335
1324
|
live: Live
|
|
1336
1325
|
loading: Loading
|
|
1326
|
+
locale: Locale
|
|
1337
1327
|
locale_changed: Locale Changed
|
|
1328
|
+
locale_not_supported_by_store: is not supported by this store
|
|
1338
1329
|
location: Location
|
|
1339
1330
|
lock: Lock
|
|
1340
1331
|
log_entries: Log Entries
|
|
@@ -1438,8 +1429,6 @@ en:
|
|
|
1438
1429
|
new_payment: New Payment
|
|
1439
1430
|
new_payment_method: New Payment Method
|
|
1440
1431
|
new_policy: New Policy
|
|
1441
|
-
new_post: New Post
|
|
1442
|
-
new_post_category: New Post Category
|
|
1443
1432
|
new_price_list: New Price List
|
|
1444
1433
|
new_product: New Product
|
|
1445
1434
|
new_promotion: New Promotion
|
|
@@ -1742,8 +1731,6 @@ en:
|
|
|
1742
1731
|
please_enter_reasonable_quantity: Please enter a reasonable quantity.
|
|
1743
1732
|
policies: Policies
|
|
1744
1733
|
populate_get_error: Something went wrong. Please try adding the item again.
|
|
1745
|
-
post_categories: Post categories
|
|
1746
|
-
posts: Posts
|
|
1747
1734
|
powered_by: Powered by
|
|
1748
1735
|
pre_tax_amount: Pre-Tax Amount
|
|
1749
1736
|
pre_tax_refund_amount: Pre-Tax Refund Amount
|
|
@@ -2302,6 +2289,7 @@ en:
|
|
|
2302
2289
|
tax_category: Tax Category
|
|
2303
2290
|
tax_code: Tax Code
|
|
2304
2291
|
tax_included: Tax (incl.)
|
|
2292
|
+
tax_inclusive: Tax inclusive
|
|
2305
2293
|
tax_rate_amount_explanation: Tax rates are a decimal amount to aid in calculations, (i.e. if the tax rate is 5% then enter 0.05)
|
|
2306
2294
|
tax_rates: Tax Rates
|
|
2307
2295
|
taxes: Taxes
|
|
@@ -2325,11 +2313,6 @@ en:
|
|
|
2325
2313
|
taxons: Taxons
|
|
2326
2314
|
terms_of_service: Terms of Service
|
|
2327
2315
|
test: Test
|
|
2328
|
-
test_mailer:
|
|
2329
|
-
test_email:
|
|
2330
|
-
greeting: Congratulations!
|
|
2331
|
-
message: If you have received this email, then your email settings are correct.
|
|
2332
|
-
subject: Test Mail
|
|
2333
2316
|
test_mode: Test Mode
|
|
2334
2317
|
text_alignment: Text alignment
|
|
2335
2318
|
thank_you_for_your_order: Thank you for your business. Please print out a copy of this confirmation page for your records.
|
|
@@ -407,22 +407,6 @@ class SpreeFourThree < ActiveRecord::Migration[5.2]
|
|
|
407
407
|
t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product"
|
|
408
408
|
end
|
|
409
409
|
|
|
410
|
-
create_table "spree_product_properties", force: :cascade do |t|
|
|
411
|
-
t.string "value"
|
|
412
|
-
t.bigint "product_id"
|
|
413
|
-
t.bigint "property_id"
|
|
414
|
-
t.datetime "created_at", precision: 6, null: false
|
|
415
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
416
|
-
t.integer "position", default: 0
|
|
417
|
-
t.boolean "show_property", default: true
|
|
418
|
-
t.string "filter_param"
|
|
419
|
-
t.index ["filter_param"], name: "index_spree_product_properties_on_filter_param"
|
|
420
|
-
t.index ["position"], name: "index_spree_product_properties_on_position"
|
|
421
|
-
t.index ["product_id"], name: "index_product_properties_on_product_id"
|
|
422
|
-
t.index ["property_id", "product_id"], name: "index_spree_product_properties_on_property_id_and_product_id", unique: true
|
|
423
|
-
t.index ["property_id"], name: "index_spree_product_properties_on_property_id"
|
|
424
|
-
end
|
|
425
|
-
|
|
426
410
|
create_table "spree_products", force: :cascade do |t|
|
|
427
411
|
t.string "name", default: "", null: false
|
|
428
412
|
t.text "description"
|
|
@@ -563,28 +547,6 @@ class SpreeFourThree < ActiveRecord::Migration[5.2]
|
|
|
563
547
|
t.index ["store_id"], name: "index_spree_promotions_stores_on_store_id"
|
|
564
548
|
end
|
|
565
549
|
|
|
566
|
-
create_table "spree_properties", force: :cascade do |t|
|
|
567
|
-
t.string "name"
|
|
568
|
-
t.string "presentation", null: false
|
|
569
|
-
t.datetime "created_at", precision: 6, null: false
|
|
570
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
571
|
-
t.boolean "filterable", default: false, null: false
|
|
572
|
-
t.string "filter_param"
|
|
573
|
-
t.index ["filter_param"], name: "index_spree_properties_on_filter_param"
|
|
574
|
-
t.index ["filterable"], name: "index_spree_properties_on_filterable"
|
|
575
|
-
t.index ["name"], name: "index_spree_properties_on_name"
|
|
576
|
-
end
|
|
577
|
-
|
|
578
|
-
create_table "spree_property_prototypes", force: :cascade do |t|
|
|
579
|
-
t.bigint "prototype_id"
|
|
580
|
-
t.bigint "property_id"
|
|
581
|
-
t.datetime "created_at"
|
|
582
|
-
t.datetime "updated_at"
|
|
583
|
-
t.index ["property_id"], name: "index_spree_property_prototypes_on_property_id"
|
|
584
|
-
t.index ["prototype_id", "property_id"], name: "index_property_prototypes_on_prototype_id_and_property_id", unique: true
|
|
585
|
-
t.index ["prototype_id"], name: "index_spree_property_prototypes_on_prototype_id"
|
|
586
|
-
end
|
|
587
|
-
|
|
588
550
|
create_table "spree_prototype_taxons", force: :cascade do |t|
|
|
589
551
|
t.bigint "taxon_id"
|
|
590
552
|
t.bigint "prototype_id"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class AddTokenDigestToSpreeApiKeys < ActiveRecord::Migration[7.2]
|
|
2
|
+
def change
|
|
3
|
+
add_column :spree_api_keys, :token_digest, :string
|
|
4
|
+
add_column :spree_api_keys, :token_prefix, :string
|
|
5
|
+
|
|
6
|
+
add_index :spree_api_keys, :token_digest, unique: true
|
|
7
|
+
|
|
8
|
+
# Replace the unconditional unique index on token with one that only covers
|
|
9
|
+
# non-NULL values (publishable keys). Secret keys store token as NULL
|
|
10
|
+
# and use token_digest for lookups instead.
|
|
11
|
+
change_column_null :spree_api_keys, :token, true
|
|
12
|
+
remove_index :spree_api_keys, :token
|
|
13
|
+
if ActiveRecord::Base.connection.adapter_name == 'Mysql2'
|
|
14
|
+
# MySQL doesn't support partial indexes, but treats NULL as distinct
|
|
15
|
+
# in unique indexes so multiple secret keys with NULL token are allowed
|
|
16
|
+
add_index :spree_api_keys, :token, unique: true
|
|
17
|
+
else
|
|
18
|
+
add_index :spree_api_keys, :token, unique: true, where: 'token IS NOT NULL'
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -77,9 +77,7 @@ class Spree::Product < Spree.base_class
|
|
|
77
77
|
include Spree::Metafields
|
|
78
78
|
|
|
79
79
|
has_many :variants, class_name: 'Spree::Variant', dependent: :destroy
|
|
80
|
-
|
|
81
|
-
has_many :properties, through: :product_properties, source: :property
|
|
82
|
-
|
|
80
|
+
|
|
83
81
|
scope :available, -> { where(available_on: ..Time.current) }
|
|
84
82
|
|
|
85
83
|
validates :name, presence: true
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
# a.get :color
|
|
16
16
|
# a.preferred_color
|
|
17
17
|
#
|
|
18
|
-
require 'spree/core/search/base'
|
|
19
18
|
require 'spree/core/preferences/configuration' # for compatibility reasons
|
|
20
19
|
require 'spree/core/preferences/runtime_configuration'
|
|
21
20
|
require 'spree/core/preferences/preferable'
|
|
@@ -83,7 +82,6 @@ module Spree
|
|
|
83
82
|
preference :mailer_logo, :string, deprecated: true
|
|
84
83
|
preference :max_level_in_taxons_menu, :integer, deprecated: true
|
|
85
84
|
preference :non_expiring_credit_types, :array, default: []
|
|
86
|
-
preference :product_properties_enabled, :boolean, default: false # enable legacy product properties
|
|
87
85
|
preference :products_per_page, :integer, default: 12
|
|
88
86
|
preference :require_master_price, :boolean, default: false
|
|
89
87
|
preference :restock_inventory, :boolean, default: true # Determines if a return item is restocked automatically once it has been received
|
|
@@ -112,7 +110,6 @@ module Spree
|
|
|
112
110
|
preference :gift_card_batch_web_limit, :integer, default: 500 # number of gift card codes to be generated in the web process, more than this will be generated in a background job
|
|
113
111
|
preference :gift_card_batch_limit, :integer, default: 50_000
|
|
114
112
|
|
|
115
|
-
attr_writer :searcher_class
|
|
116
113
|
end
|
|
117
114
|
end
|
|
118
115
|
end
|
|
@@ -34,8 +34,7 @@ module Spree
|
|
|
34
34
|
def permitted_product_attributes
|
|
35
35
|
permitted_attributes.product_attributes + [
|
|
36
36
|
variants_attributes: permitted_variant_attributes + ['id', :_destroy],
|
|
37
|
-
master_attributes: permitted_variant_attributes + ['id']
|
|
38
|
-
product_properties_attributes: permitted_product_properties_attributes + ['id', :_destroy]
|
|
37
|
+
master_attributes: permitted_variant_attributes + ['id']
|
|
39
38
|
]
|
|
40
39
|
end
|
|
41
40
|
|
|
@@ -56,9 +56,8 @@ module Spree
|
|
|
56
56
|
# sorter
|
|
57
57
|
collection_sorter: 'Spree::BaseSorter',
|
|
58
58
|
order_sorter: 'Spree::BaseSorter',
|
|
59
|
+
posts_sorter: nil,
|
|
59
60
|
products_sorter: 'Spree::Products::Sort',
|
|
60
|
-
posts_sorter: 'Spree::Posts::Sort',
|
|
61
|
-
|
|
62
61
|
# paginator
|
|
63
62
|
collection_paginator: 'Spree::Shared::Paginate',
|
|
64
63
|
|
|
@@ -87,13 +86,6 @@ module Spree
|
|
|
87
86
|
|
|
88
87
|
payment_create_service: 'Spree::Payments::Create',
|
|
89
88
|
|
|
90
|
-
# data feeds
|
|
91
|
-
data_feeds_google_rss_service: 'Spree::DataFeeds::Google::Rss',
|
|
92
|
-
data_feeds_google_optional_attributes_service: 'Spree::DataFeeds::Google::OptionalAttributes',
|
|
93
|
-
data_feeds_google_required_attributes_service: 'Spree::DataFeeds::Google::RequiredAttributes',
|
|
94
|
-
data_feeds_google_optional_sub_attributes_service: 'Spree::DataFeeds::Google::OptionalSubAttributes',
|
|
95
|
-
data_feeds_google_products_list: 'Spree::DataFeeds::Google::ProductsList',
|
|
96
|
-
|
|
97
89
|
# finders
|
|
98
90
|
address_finder: 'Spree::Addresses::Find',
|
|
99
91
|
country_finder: 'Spree::Countries::Find',
|
|
@@ -103,8 +95,8 @@ module Spree
|
|
|
103
95
|
current_store_finder: 'Spree::Stores::FindDefault',
|
|
104
96
|
completed_order_finder: 'Spree::Orders::FindComplete',
|
|
105
97
|
credit_card_finder: 'Spree::CreditCards::Find',
|
|
98
|
+
posts_finder: nil,
|
|
106
99
|
products_finder: 'Spree::Products::Find',
|
|
107
|
-
posts_finder: 'Spree::Posts::Find',
|
|
108
100
|
taxon_finder: 'Spree::Taxons::Find',
|
|
109
101
|
line_item_by_variant_finder: 'Spree::LineItems::FindByVariant',
|
|
110
102
|
variant_finder: 'Spree::Variants::Find'
|
data/lib/spree/core/engine.rb
CHANGED
|
@@ -14,7 +14,6 @@ module Spree
|
|
|
14
14
|
:promotions,
|
|
15
15
|
:pricing,
|
|
16
16
|
:line_item_comparison_hooks,
|
|
17
|
-
:data_feed_types,
|
|
18
17
|
:export_types,
|
|
19
18
|
:import_types,
|
|
20
19
|
:taxon_rules,
|
|
@@ -43,10 +42,6 @@ module Spree
|
|
|
43
42
|
# Add app/subscribers to autoload paths
|
|
44
43
|
config.paths.add 'app/subscribers', eager_load: true
|
|
45
44
|
|
|
46
|
-
rake_tasks do
|
|
47
|
-
load File.join(root, 'lib', 'tasks', 'exchanges.rake')
|
|
48
|
-
end
|
|
49
|
-
|
|
50
45
|
initializer 'spree.environment', before: :load_config_initializers do |app|
|
|
51
46
|
app.config.spree = Environment.new(SpreeCalculators.new, SpreeValidators.new, Spree::Core::Configuration.new, Spree::Core::Dependencies.new)
|
|
52
47
|
|
|
@@ -127,7 +122,6 @@ module Spree
|
|
|
127
122
|
|
|
128
123
|
Rails.application.config.spree.payment_methods = [
|
|
129
124
|
Spree::Gateway::Bogus,
|
|
130
|
-
Spree::Gateway::BogusSimple,
|
|
131
125
|
Spree::Gateway::CustomPaymentSourceMethod,
|
|
132
126
|
Spree::PaymentMethod::Check,
|
|
133
127
|
Spree::PaymentMethod::StoreCredit
|
|
@@ -181,10 +175,6 @@ module Spree
|
|
|
181
175
|
Promotion::Actions::FreeShipping
|
|
182
176
|
]
|
|
183
177
|
|
|
184
|
-
Rails.application.config.spree.data_feed_types = [
|
|
185
|
-
Spree::DataFeed::Google
|
|
186
|
-
]
|
|
187
|
-
|
|
188
178
|
Rails.application.config.spree.export_types = [
|
|
189
179
|
Spree::Exports::Products,
|
|
190
180
|
Spree::Exports::Orders,
|
|
@@ -212,7 +202,6 @@ module Spree
|
|
|
212
202
|
Rails.application.config.spree.translatable_resources = [
|
|
213
203
|
Spree::OptionType,
|
|
214
204
|
Spree::Product,
|
|
215
|
-
Spree::Property,
|
|
216
205
|
Spree::Taxon,
|
|
217
206
|
Spree::Taxonomy,
|
|
218
207
|
Spree::Store,
|
|
@@ -243,8 +232,6 @@ module Spree
|
|
|
243
232
|
Spree::Payment,
|
|
244
233
|
Spree::PaymentMethod,
|
|
245
234
|
Spree::PaymentSource,
|
|
246
|
-
Spree::Post,
|
|
247
|
-
Spree::PostCategory,
|
|
248
235
|
Spree::Product,
|
|
249
236
|
Spree::Promotion,
|
|
250
237
|
Spree::Refund,
|
|
@@ -12,9 +12,7 @@ module Spree
|
|
|
12
12
|
# Returns the best price for the variant
|
|
13
13
|
# @return [Spree::Price]
|
|
14
14
|
def resolve
|
|
15
|
-
|
|
16
|
-
find_best_price
|
|
17
|
-
end
|
|
15
|
+
find_best_price
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
private
|
|
@@ -118,12 +116,6 @@ module Spree
|
|
|
118
116
|
price_list_id: nil
|
|
119
117
|
)
|
|
120
118
|
end
|
|
121
|
-
|
|
122
|
-
# Returns the cache key for the resolver
|
|
123
|
-
# @return [String]
|
|
124
|
-
def cache_key
|
|
125
|
-
"#{context.cache_key}/resolved_price"
|
|
126
|
-
end
|
|
127
119
|
end
|
|
128
120
|
end
|
|
129
121
|
end
|
data/lib/spree/core/version.rb
CHANGED
data/lib/spree/core.rb
CHANGED
|
@@ -11,7 +11,7 @@ require 'action_cable/engine'
|
|
|
11
11
|
require 'mail'
|
|
12
12
|
require 'action_mailer/railtie'
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
require 'acts_as_list'
|
|
16
16
|
require 'acts-as-taggable-on'
|
|
17
17
|
require 'awesome_nested_set'
|
|
@@ -28,7 +28,7 @@ require 'state_machines-activerecord'
|
|
|
28
28
|
require 'active_storage_validations'
|
|
29
29
|
require 'wannabe_bool'
|
|
30
30
|
require 'geocoder'
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
require 'safely_block'
|
|
33
33
|
require 'ar_lazy_preload'
|
|
34
34
|
require 'sqids'
|
|
@@ -41,7 +41,7 @@ module Spree
|
|
|
41
41
|
mattr_accessor :base_class, :user_class, :admin_user_class,
|
|
42
42
|
:private_storage_service_name, :public_storage_service_name,
|
|
43
43
|
:cdn_host, :root_domain, :searcher_class, :events_adapter_class, :queues,
|
|
44
|
-
:google_places_api_key
|
|
44
|
+
:google_places_api_key
|
|
45
45
|
|
|
46
46
|
def self.base_class(constantize: true)
|
|
47
47
|
@@base_class ||= 'Spree::Base'
|
|
@@ -113,14 +113,14 @@ module Spree
|
|
|
113
113
|
)
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
# @deprecated Spree.searcher_class is deprecated and will be removed in Spree 5.5.
|
|
117
|
+
def self.searcher_class=(value)
|
|
118
|
+
Spree::Deprecation.warn('Spree.searcher_class is deprecated and will be removed in Spree 5.5. Please remove it from your initializer.')
|
|
119
|
+
@@searcher_class = value
|
|
120
|
+
end
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
elsif @@searcher_class.is_a?(String) || @@searcher_class.is_a?(Symbol)
|
|
122
|
-
constantize ? @@searcher_class.to_s.constantize : @@searcher_class.to_s
|
|
123
|
-
end
|
|
122
|
+
def self.searcher_class(constantize: true)
|
|
123
|
+
@@searcher_class
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
# Returns the events adapter class used for publishing and subscribing to events.
|
|
@@ -144,10 +144,6 @@ module Spree
|
|
|
144
144
|
@@google_places_api_key
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
-
def self.screenshot_api_token
|
|
148
|
-
@@screenshot_api_token
|
|
149
|
-
end
|
|
150
|
-
|
|
151
147
|
def self.always_use_translations?
|
|
152
148
|
Spree::Config.always_use_translations
|
|
153
149
|
end
|
|
@@ -246,14 +242,6 @@ module Spree
|
|
|
246
242
|
Rails.application.config.spree.line_item_comparison_hooks = value
|
|
247
243
|
end
|
|
248
244
|
|
|
249
|
-
def self.data_feed_types
|
|
250
|
-
Rails.application.config.spree.data_feed_types
|
|
251
|
-
end
|
|
252
|
-
|
|
253
|
-
def self.data_feed_types=(value)
|
|
254
|
-
Rails.application.config.spree.data_feed_types = value
|
|
255
|
-
end
|
|
256
|
-
|
|
257
245
|
def self.export_types
|
|
258
246
|
Rails.application.config.spree.export_types
|
|
259
247
|
end
|
|
@@ -414,7 +402,6 @@ module Spree
|
|
|
414
402
|
end
|
|
415
403
|
|
|
416
404
|
module Core
|
|
417
|
-
autoload :ProductFilters, 'spree/core/product_filters'
|
|
418
405
|
autoload :TokenGenerator, 'spree/core/token_generator'
|
|
419
406
|
|
|
420
407
|
class GatewayError < RuntimeError; end
|
|
@@ -441,11 +428,9 @@ require 'spree/webhooks'
|
|
|
441
428
|
|
|
442
429
|
require 'spree/core/partials'
|
|
443
430
|
require 'spree/core/importer'
|
|
444
|
-
require 'spree/core/query_filters'
|
|
445
431
|
require 'spree/core/controller_helpers/auth'
|
|
446
432
|
require 'spree/core/controller_helpers/common'
|
|
447
433
|
require 'spree/core/controller_helpers/order'
|
|
448
|
-
require 'spree/core/controller_helpers/search'
|
|
449
434
|
require 'spree/core/controller_helpers/store'
|
|
450
435
|
require 'spree/core/controller_helpers/strong_parameters'
|
|
451
436
|
require 'spree/core/controller_helpers/locale'
|
|
@@ -39,15 +39,11 @@ module Spree
|
|
|
39
39
|
:payment_session_attributes,
|
|
40
40
|
:payment_setup_session_attributes,
|
|
41
41
|
:policy_attributes,
|
|
42
|
-
:post_attributes,
|
|
43
|
-
:post_category_attributes,
|
|
44
42
|
:price_list_attributes,
|
|
45
43
|
:product_attributes,
|
|
46
44
|
:promotion_attributes,
|
|
47
45
|
:promotion_rule_attributes,
|
|
48
46
|
:promotion_action_attributes,
|
|
49
|
-
:product_properties_attributes,
|
|
50
|
-
:property_attributes,
|
|
51
47
|
:refund_attributes,
|
|
52
48
|
:refund_reason_attributes,
|
|
53
49
|
:reimbursement_attributes,
|
|
@@ -97,7 +93,7 @@ module Spree
|
|
|
97
93
|
|
|
98
94
|
@@checkout_attributes = [
|
|
99
95
|
:coupon_code, :email, :shipping_method_id, :special_instructions, :use_billing, :use_shipping,
|
|
100
|
-
:user_id, :bill_address_id, :ship_address_id, :accept_marketing, :signup_for_an_account, :currency,
|
|
96
|
+
:user_id, :bill_address_id, :ship_address_id, :accept_marketing, :signup_for_an_account, :currency, :locale,
|
|
101
97
|
:internal_note
|
|
102
98
|
]
|
|
103
99
|
|
|
@@ -140,7 +136,7 @@ module Spree
|
|
|
140
136
|
|
|
141
137
|
@@invitation_attributes = [:email, :expires_at, :role_id]
|
|
142
138
|
|
|
143
|
-
@@line_item_attributes = [:id, :variant_id, :quantity]
|
|
139
|
+
@@line_item_attributes = [:id, :variant_id, :quantity, { metadata: {} }]
|
|
144
140
|
|
|
145
141
|
@@market_attributes = [:name, :currency, :default_locale, :supported_locales,
|
|
146
142
|
:tax_inclusive, :default, :position, country_ids: []]
|
|
@@ -177,14 +173,8 @@ module Spree
|
|
|
177
173
|
|
|
178
174
|
@@policy_attributes = [:name, :slug, :body]
|
|
179
175
|
|
|
180
|
-
@@post_attributes = [:title, :meta_title, :meta_description, :slug, :author_id, :post_category_id, :published_at, :content, :excerpt, :image, tag_list: []]
|
|
181
|
-
|
|
182
|
-
@@post_category_attributes = [:title, :slug, :description]
|
|
183
|
-
|
|
184
176
|
@@price_list_attributes = [:name, :description, :match_policy, :starts_at, :ends_at, :status, :position]
|
|
185
177
|
|
|
186
|
-
@@product_properties_attributes = [:property_name, :property_id, :value, :position, :_destroy]
|
|
187
|
-
|
|
188
178
|
@@product_attributes = [
|
|
189
179
|
:name, :description, :available_on, :make_active_at, :discontinue_on, :permalink, :meta_description,
|
|
190
180
|
:meta_keywords, :meta_title, :price, :sku, :deleted_at, :prototype_id,
|
|
@@ -210,8 +200,6 @@ module Spree
|
|
|
210
200
|
|
|
211
201
|
@@promotion_action_attributes = [:type, :calculator_type, calculator_attributes: {}, promotion_action_line_items_attributes: [:id, :promotion_action_id, :variant_id, :quantity, :_destroy]]
|
|
212
202
|
|
|
213
|
-
@@property_attributes = [:name, :presentation, :position, :kind, :display_on]
|
|
214
|
-
|
|
215
203
|
@@refund_attributes = [:amount, :refund_reason_id]
|
|
216
204
|
|
|
217
205
|
@@refund_reason_attributes = [:name, :active, :mutable]
|
|
@@ -23,12 +23,7 @@ FactoryBot.define do
|
|
|
23
23
|
name { 'Credit Card' }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
# Leaving this factory in place with bogus in case anyone is using it.
|
|
28
|
-
factory :simple_credit_card_payment_method, parent: :payment_method, class: Spree::Gateway::BogusSimple do
|
|
29
|
-
type { 'Spree::Gateway::BogusSimple' }
|
|
30
|
-
name { 'Credit Card' }
|
|
31
|
-
end
|
|
26
|
+
factory :simple_credit_card_payment_method, parent: :credit_card_payment_method
|
|
32
27
|
|
|
33
28
|
factory :store_credit_payment_method, parent: :payment_method, class: Spree::PaymentMethod::StoreCredit do
|
|
34
29
|
type { 'Spree::PaymentMethod::StoreCredit' }
|
|
@@ -50,13 +50,6 @@ FactoryBot.define do
|
|
|
50
50
|
factory :product_with_option_types do
|
|
51
51
|
after(:create) { |product| create(:product_option_type, product: product) }
|
|
52
52
|
end
|
|
53
|
-
factory :product_with_properties do
|
|
54
|
-
after(:create) do |product|
|
|
55
|
-
property = create(:property, :brand)
|
|
56
|
-
create(:product_property, product: product, property: property, value: 'Epsilon')
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
53
|
factory :digital_product do
|
|
61
54
|
track_inventory { false }
|
|
62
55
|
shipping_category { |r| Spree::ShippingCategory.digital || r.association(:digital_shipping_category) }
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
2
|
factory :prototype, class: Spree::Prototype do
|
|
3
3
|
name { 'Baseball Cap' }
|
|
4
|
-
properties { [build(:property)] }
|
|
5
4
|
end
|
|
6
5
|
factory :prototype_with_option_types, class: Spree::Prototype do
|
|
7
6
|
name { 'Baseball Cap' }
|
|
8
|
-
properties { [build(:property)] }
|
|
9
7
|
option_types { [build(:option_type)] }
|
|
10
8
|
end
|
|
11
9
|
end
|