e_plat 1.0.0.pre.rc.6 → 1.0.0.pre.rc.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fe157545faee8c7aec643aa5082ae647a1f29bbeb0d272cd4fd2d1035fc70ad
|
4
|
+
data.tar.gz: 40793dde1a3811f05b9173acca6a1d4660489252c4e0773d50604a039320edf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbd52d651ca95288d1119c88425fc7cb26fd46ffbb84712713fe2ffbddb00330d3ae2b0d6a843d76bde48b7ae03a4a8a1284ce76d98f6b6232a507c8e1abf4ee
|
7
|
+
data.tar.gz: 2f7c9289b55692ed10d4da946a2d7aaf64715f2db0ae27aa63bd38fade755e5db46c8c202ab90c41c4640267a84069dcd94466267c2bdd6f277f8d66cae9a363
|
data/lib/e_plat/resource/base.rb
CHANGED
@@ -8,7 +8,7 @@ module EPlat
|
|
8
8
|
|
9
9
|
self.connection_class = EPlat::Connection
|
10
10
|
self.collection_parser = EPlat::Collection
|
11
|
-
self.timeout =
|
11
|
+
self.timeout = 20
|
12
12
|
self.site = "/" # this is overwritten below in initialize_singleton! when EPlat::Session is initialized
|
13
13
|
add_response_method :full_response #full response of the request
|
14
14
|
|
@@ -30,7 +30,7 @@ module EPlat
|
|
30
30
|
self.site = client.base_url # .site is an ActiveResource method that uses the threadsafe _site attribute underneath
|
31
31
|
self.prefix = client.url_prefix(klass: self) # this is overwritten below in prefix= for threadsafety
|
32
32
|
|
33
|
-
self.timeout =
|
33
|
+
self.timeout = 20
|
34
34
|
self.include_format_in_path = client.include_format_in_path?
|
35
35
|
self.mapping = mapping_instance
|
36
36
|
|
@@ -57,7 +57,7 @@ module EPlat
|
|
57
57
|
|
58
58
|
if paginates_via_graphql?
|
59
59
|
arg_name = (url == @next) ? "after" : "before"
|
60
|
-
resource_class.find(:all, params: {arg_name => url})
|
60
|
+
resource_class.find(:all, params: {arg_name => url, first: 100})
|
61
61
|
else
|
62
62
|
resource_class.all(from: url)
|
63
63
|
end
|
@@ -32,7 +32,7 @@ module EPlat::Shopify
|
|
32
32
|
templateSuffix
|
33
33
|
title
|
34
34
|
vendor
|
35
|
-
variants(first:
|
35
|
+
variants(first: #{EPlat::Product::INITIAL_SHOPIFY_VARIANT_LIMIT}) {
|
36
36
|
nodes {
|
37
37
|
#{Variant.graphql_fields}
|
38
38
|
}
|
@@ -40,7 +40,7 @@ module EPlat::Shopify
|
|
40
40
|
options {
|
41
41
|
#{Option.graphql_fields}
|
42
42
|
}
|
43
|
-
images(first:
|
43
|
+
images(first: #{EPlat::Product::INITIAL_SHOPIFY_IMAGE_LIMIT}) {
|
44
44
|
nodes {
|
45
45
|
#{Image.graphql_fields}
|
46
46
|
}
|
@@ -4,6 +4,9 @@ module EPlat
|
|
4
4
|
has_many :images, class_name: "EPlat::Product::Image"
|
5
5
|
has_many :options, class_name: "EPlat::Product::Option"
|
6
6
|
|
7
|
+
INITIAL_SHOPIFY_VARIANT_LIMIT = 25
|
8
|
+
INITIAL_SHOPIFY_IMAGE_LIMIT = 25
|
9
|
+
|
7
10
|
include Concerns::Metafieldable
|
8
11
|
|
9
12
|
schema do
|
@@ -43,6 +46,7 @@ module EPlat
|
|
43
46
|
|
44
47
|
def load_all_variants # slow method, run async
|
45
48
|
return EPlat::Collection.new(variants) unless client.shopify? && client.uses_graphql_for_products?
|
49
|
+
return EPlat::Collection.new(variants) unless could_have_more_variants?
|
46
50
|
|
47
51
|
@variants_collection = variants_collection
|
48
52
|
@saved_variants = @variants_collection.to_a
|
@@ -58,6 +62,12 @@ module EPlat
|
|
58
62
|
|
59
63
|
self.variants = EPlat::Collection.new(@saved_variants)
|
60
64
|
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def could_have_more_variants?
|
69
|
+
variants.size == INITIAL_SHOPIFY_VARIANT_LIMIT
|
70
|
+
end
|
61
71
|
|
62
72
|
end
|
63
|
-
end
|
73
|
+
end
|
data/lib/e_plat/version.rb
CHANGED