solidus_core 2.6.3 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/helpers/spree/taxons_helper.rb +2 -2
- data/app/models/spree/product/scopes.rb +4 -3
- 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: b3b81a2fffd48fc3f7d19f9d2a1a97508fb87670806a32b846286ad9c776bb3d
|
4
|
+
data.tar.gz: 110be3514bd3790c56161fd483fcab60ec9775d47713e775e69e3b771e828f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a240cdb0e5706a7185c2c5892d1ce46b7be0731e01069af22377763a980c97926cd162b1ed7b0e28a930673fcca48029c3f43135ddc168f9ca9ac0a31c370798
|
7
|
+
data.tar.gz: d5ff58c166cd979378712de1b6b0152889a232cef0b4af0aee111cc0681cc1ad23040b81e5180bf0b3abcbe6e20a029df4b390a0710aefa6a513231621a2b8ea
|
@@ -7,12 +7,12 @@ module Spree
|
|
7
7
|
# to show the most popular products for a particular taxon (that is an exercise left to the developer.)
|
8
8
|
def taxon_preview(taxon, max = 4)
|
9
9
|
price_scope = Spree::Price.where(current_pricing_options.search_arguments)
|
10
|
-
products = taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT
|
10
|
+
products = taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT spree_products.*, spree_products_taxons.position").limit(max)
|
11
11
|
if products.size < max
|
12
12
|
products_arel = Spree::Product.arel_table
|
13
13
|
taxon.descendants.each do |descendent_taxon|
|
14
14
|
to_get = max - products.length
|
15
|
-
products += descendent_taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT
|
15
|
+
products += descendent_taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT spree_products.*, spree_products_taxons.position").where(products_arel[:id].not_in(products.map(&:id))).limit(to_get)
|
16
16
|
break if products.size >= max
|
17
17
|
end
|
18
18
|
end
|
@@ -63,9 +63,10 @@ module Spree
|
|
63
63
|
#
|
64
64
|
# SELECT COUNT(*) ...
|
65
65
|
add_search_scope :in_taxon do |taxon|
|
66
|
-
includes(:classifications)
|
67
|
-
|
68
|
-
|
66
|
+
includes(:classifications)
|
67
|
+
.where('spree_products_taxons.taxon_id' => taxon.self_and_descendants.pluck(:id))
|
68
|
+
.select(Spree::Classification.arel_table[:position])
|
69
|
+
.order(Spree::Classification.arel_table[:position].asc)
|
69
70
|
end
|
70
71
|
|
71
72
|
# This scope selects products in all taxons AND all its descendants
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|