solidus_core 2.8.2 → 2.8.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.
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: 42c525de0b0430c5fe1eb14d2d3261a4f3252372a060d1fb4f7a4d0b0ae47e1a
|
4
|
+
data.tar.gz: 9a0cf5c511c9e74d86178572a505f5bc7228a5c6e1596aca217356525984be8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aacc059f964c7a0f57c562f2e81a44c6bff43f7ed28dd89f07e1fc37f9ef401f64ca944d8f4dcec7fe7963cf0ce85b106d95fdaf500377c99f8f0e6b8f1898d5
|
7
|
+
data.tar.gz: 2c0ced8e5424e5130e43c7b4e710f9d02080805fe7198f74ee0c37fb50ebb70378752823663f80b6d59312166393ad780bde83f9a24f065a20efe12b9e481314
|
@@ -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.8.
|
4
|
+
version: 2.8.3
|
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
|