spree_core 4.1.2 → 4.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b705f768f8ff59c9810f09dd3a99a68c2dc13811769a180069b9261009d9cdff
4
- data.tar.gz: a64dba1a7bf10999d6e588a9411e39172f25c93f9a26876719b1d6da5940bb0a
3
+ metadata.gz: cba2996dac2e758ba562efcfc4e1bf1f99c873bcb0af1e878ce372339c86263e
4
+ data.tar.gz: 1404bec2819dc8872517d3d19a5f5faa2683e5b7c3265e4afeeaad6ff7f8476c
5
5
  SHA512:
6
- metadata.gz: 0d49c78014b9a7899e754dbe299bb00b293939d7e25e5091cf3124a0951da7076303ce358da23e790f7efe626bce656b09d9cdf3a5a512cdefbff5cee739faa2
7
- data.tar.gz: 6dbe8cdd4dd58cb1f8a8c5e9bd6b1d34344e119f8df0839a4824d9f3fc809f1215def97bec41b47732d2530c48e63a0c5e5f808c027353b551eb169b004ba013
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).distinct.where(spree_variants: { sku: skus })
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).distinct.where(spree_taxons: { id: 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/#{ids}-#{params[:page]}-#{params[:sort_by]}-#{max_updated_at}-#{@taxon&.id}"
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
 
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '4.1.2'
3
+ '4.1.3'
4
4
  end
5
5
  end
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.2
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-27 00:00:00.000000000 Z
11
+ date: 2020-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant