spree_core 5.0.1 → 5.0.2
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/addresses/find.rb +21 -0
- data/app/finders/spree/products/find.rb +13 -1
- data/app/models/spree/product.rb +11 -0
- data/app/services/spree/locales/set_fallback_locale_for_store.rb +2 -0
- data/config/locales/en.yml +2 -2
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/permitted_attributes.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b48665b46a9dce64b6f759e3b403c2413c0987726477b894530102991e059887
|
4
|
+
data.tar.gz: 1ca8171bbfdd308a1a737b3693f704ba9065b917117b51add94a0330789cac21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7f75d17b2b9c08bc6ce85adbec6b7b20252d02a302bfc8594650ee84d69bc72ebdd168f038513e4845ca195f60da241fb5292afce2620a848c08b8db5cf6bc6
|
7
|
+
data.tar.gz: 0c8d2488ec8d9446bec3041b3e2b135482a5e1de436baec805c257ab0f59210e59dbaf102733d382df9aff0023909d65a77453dea086bac2b5b79afcc05b7d4c
|
@@ -1,6 +1,27 @@
|
|
1
1
|
module Spree
|
2
2
|
module Addresses
|
3
3
|
class Find < ::Spree::BaseFinder
|
4
|
+
def initialize(scope:, params:)
|
5
|
+
super
|
6
|
+
@exclude_quick_checkout = params.dig(:filter, :exclude_quick_checkout)
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
addresses = scope
|
11
|
+
exclude_quick_checkout(addresses)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def exclude_quick_checkout?
|
17
|
+
@exclude_quick_checkout.present?
|
18
|
+
end
|
19
|
+
|
20
|
+
def exclude_quick_checkout(addresses)
|
21
|
+
return addresses unless exclude_quick_checkout?
|
22
|
+
|
23
|
+
addresses.not_quick_checkout
|
24
|
+
end
|
4
25
|
end
|
5
26
|
end
|
6
27
|
end
|
@@ -12,6 +12,7 @@ module Spree
|
|
12
12
|
@taxons = taxon_ids(params.dig(:filter, :taxons))
|
13
13
|
@concat_taxons = taxon_ids(params.dig(:filter, :concat_taxons))
|
14
14
|
@name = params.dig(:filter, :name)
|
15
|
+
@slug = params.dig(:filter, :slug)
|
15
16
|
@options = params.dig(:filter, :options).try(:to_unsafe_hash)
|
16
17
|
@option_value_ids = params.dig(:filter, :option_value_ids)
|
17
18
|
@sort_by = params.dig(:sort_by)
|
@@ -41,6 +42,7 @@ module Spree
|
|
41
42
|
products = by_taxons(products)
|
42
43
|
products = by_concat_taxons(products)
|
43
44
|
products = by_name(products)
|
45
|
+
products = by_slug(products)
|
44
46
|
products = by_options(products)
|
45
47
|
products = by_option_value_ids(products)
|
46
48
|
products = by_properties(products)
|
@@ -60,7 +62,7 @@ module Spree
|
|
60
62
|
|
61
63
|
attr_reader :ids, :skus, :price, :currency, :taxons, :concat_taxons, :name, :options, :option_value_ids, :scope,
|
62
64
|
:sort_by, :deleted, :discontinued, :properties, :store, :in_stock, :backorderable, :purchasable, :tags,
|
63
|
-
:query, :vendor_ids, :out_of_stock
|
65
|
+
:query, :vendor_ids, :out_of_stock, :slug
|
64
66
|
|
65
67
|
def query?
|
66
68
|
query.present?
|
@@ -94,6 +96,10 @@ module Spree
|
|
94
96
|
name.present?
|
95
97
|
end
|
96
98
|
|
99
|
+
def slug?
|
100
|
+
slug.present?
|
101
|
+
end
|
102
|
+
|
97
103
|
def options?
|
98
104
|
options.present?
|
99
105
|
end
|
@@ -172,6 +178,12 @@ module Spree
|
|
172
178
|
products.i18n { name.matches("%#{product_name}%") }
|
173
179
|
end
|
174
180
|
|
181
|
+
def by_slug(products)
|
182
|
+
return products unless slug.present?
|
183
|
+
|
184
|
+
products.i18n.where(slug: slug)
|
185
|
+
end
|
186
|
+
|
175
187
|
def by_options(products)
|
176
188
|
return products unless options?
|
177
189
|
|
data/app/models/spree/product.rb
CHANGED
@@ -512,6 +512,17 @@ module Spree
|
|
512
512
|
where conditions.inject(:or)
|
513
513
|
end
|
514
514
|
|
515
|
+
def self.slug_available?(slug, id)
|
516
|
+
!where(slug: slug).where.not(id: id).exists?
|
517
|
+
end
|
518
|
+
|
519
|
+
def ensure_slug_is_unique(candidate_slug)
|
520
|
+
return slug if candidate_slug.blank? || slug.blank?
|
521
|
+
return candidate_slug if self.class.slug_available?(candidate_slug, id)
|
522
|
+
|
523
|
+
normalize_friendly_id([candidate_slug, uuid_for_friendly_id])
|
524
|
+
end
|
525
|
+
|
515
526
|
# Suitable for displaying only variants that has at least one option value.
|
516
527
|
# There may be scenarios where an option type is removed and along with it
|
517
528
|
# all option values. At that point all variants associated with only those
|
@@ -3,6 +3,8 @@ module Spree
|
|
3
3
|
class SetFallbackLocaleForStore
|
4
4
|
def call(store:)
|
5
5
|
store_default_locale = store.default_locale
|
6
|
+
return unless store_default_locale.present?
|
7
|
+
|
6
8
|
fallbacks = store.supported_locales_list.each_with_object({}) do |locale, object|
|
7
9
|
object[locale] = [store_default_locale]
|
8
10
|
end
|
data/config/locales/en.yml
CHANGED
@@ -527,7 +527,6 @@ en:
|
|
527
527
|
account: Account
|
528
528
|
account_info: Account info
|
529
529
|
account_members: Team
|
530
|
-
account_updated: Account updated
|
531
530
|
action: Action
|
532
531
|
actions:
|
533
532
|
approve: Approve
|
@@ -1043,6 +1042,8 @@ en:
|
|
1043
1042
|
font_size_scale: Font size scale
|
1044
1043
|
fonts: Fonts
|
1045
1044
|
footer: Footer
|
1045
|
+
forbidden: Access denied
|
1046
|
+
forbidden_message: You are not authorized to access this page.
|
1046
1047
|
forgot_password: Forgot password?
|
1047
1048
|
free: Free
|
1048
1049
|
free_shipping: Free Shipping
|
@@ -1519,7 +1520,6 @@ en:
|
|
1519
1520
|
permalink: Permalink
|
1520
1521
|
personal_details: Personal details
|
1521
1522
|
phone: Phone
|
1522
|
-
place_now: Place now
|
1523
1523
|
place_order: Place Order
|
1524
1524
|
please_check_back_soon: Please check back soon.
|
1525
1525
|
please_define_payment_methods: Please define some payment methods first.
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-04-
|
13
|
+
date: 2025-04-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n-tasks
|
@@ -1308,9 +1308,9 @@ licenses:
|
|
1308
1308
|
- BSD-3-Clause
|
1309
1309
|
metadata:
|
1310
1310
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1311
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.
|
1311
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.2
|
1312
1312
|
documentation_uri: https://docs.spreecommerce.org/
|
1313
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.0.
|
1313
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.0.2
|
1314
1314
|
post_install_message:
|
1315
1315
|
rdoc_options: []
|
1316
1316
|
require_paths:
|