spree_core 4.1.2 → 4.1.3
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 +3 -4
- data/app/helpers/spree/products_helper.rb +1 -6
- data/lib/spree/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba2996dac2e758ba562efcfc4e1bf1f99c873bcb0af1e878ce372339c86263e
|
4
|
+
data.tar.gz: 1404bec2819dc8872517d3d19a5f5faa2683e5b7c3265e4afeeaad6ff7f8476c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628cdea24cd029809e4e1d1861ffa5ac90e2de240f5b779d1cfa02e9d9c3728a8f251092ae345e741bd56d060aeecc71d9a8716e0c276a488065dc7169cb04af
|
7
|
+
data.tar.gz: 38ff19725ca382a75cc8735285be96d7f786832c86f36db0f8b1164b3914a280c57502df22db8c8e82f1fb84039b5f574454934a1596182a4a312f7355877118
|
@@ -29,7 +29,7 @@ module Spree
|
|
29
29
|
products = include_discontinued(products)
|
30
30
|
products = ordered(products)
|
31
31
|
|
32
|
-
products
|
32
|
+
products.distinct
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
@@ -81,14 +81,13 @@ module Spree
|
|
81
81
|
def by_skus(products)
|
82
82
|
return products unless skus?
|
83
83
|
|
84
|
-
products.joins(:variants_including_master).
|
84
|
+
products.joins(:variants_including_master).where(spree_variants: { sku: skus })
|
85
85
|
end
|
86
86
|
|
87
87
|
def by_price(products)
|
88
88
|
return products unless price?
|
89
89
|
|
90
90
|
products.joins(master: :default_price).
|
91
|
-
distinct.
|
92
91
|
where(
|
93
92
|
spree_prices: {
|
94
93
|
amount: price.min..price.max,
|
@@ -100,7 +99,7 @@ module Spree
|
|
100
99
|
def by_taxons(products)
|
101
100
|
return products unless taxons?
|
102
101
|
|
103
|
-
products.joins(:taxons).
|
102
|
+
products.joins(:taxons).where(spree_taxons: { id: taxons })
|
104
103
|
end
|
105
104
|
|
106
105
|
def by_name(products)
|
@@ -58,13 +58,8 @@ module Spree
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def cache_key_for_products(products = @products, additional_cache_key = nil)
|
61
|
-
ids = if products.is_a?(Array)
|
62
|
-
products.map(&:id)
|
63
|
-
else
|
64
|
-
products.ids
|
65
|
-
end.join('-')
|
66
61
|
max_updated_at = (products.maximum(:updated_at) || Date.today).to_s(:number)
|
67
|
-
products_cache_keys = "spree/products/#{
|
62
|
+
products_cache_keys = "spree/products/#{products.map(&:id).join('-')}-#{params[:page]}-#{params[:sort_by]}-#{max_updated_at}-#{@taxon&.id}"
|
68
63
|
(common_product_cache_keys + [products_cache_keys] + [additional_cache_key]).compact.join('/')
|
69
64
|
end
|
70
65
|
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|