shopifydev 0.0.20 → 0.0.22
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 +8 -8
- data/README.md +3 -1
- data/lib/shopifydev/shopify_api/caches.rb +13 -2
- data/lib/shopifydev/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDAzOGMwZTczZTY0NTNmNDQ3NDAyMzZkOTZhNmI2MDNjMzcwOWQxZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTYzZjQ0MGEzMmNmZjk0YTgyNDI5N2I1N2JlZGU5MzU0MWY5N2U2YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODYwNTAwZDQxODQ1YTFhMTQ4ZjRkY2MyNGQ5MzZkYzJjYjNmMWU1ZmNlZDQz
|
10
|
+
ZDhkYTFkYTcwNDZiN2UwY2VlZTM0NzJjOGU1YzE2M2U0YWRmZGU2NWY2ZGVj
|
11
|
+
YzMzNDBkYzEzNDkzOTdiZGJjNTY2ZDk5NjFkZjViMDNkMTZiNGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmY3YTUzNDlkYzAwZGFiOWUzNmUxNjg5OTg4MDM2OTMxNmUwNTkwYjQzNTM5
|
14
|
+
NDMwNzdkNGM1MzI4NDQ2Y2Y2ZDE0OWM5YTRkNWFmMTUxY2Y1YTE3YWQwMTM5
|
15
|
+
NGM5ODBiYWJkZTkwM2ZlNDhiYmNlNmNkODdjN2FhODQ2MDg0ODU=
|
data/README.md
CHANGED
@@ -125,11 +125,13 @@ Assuming you ```cd ShopifyAPI```:
|
|
125
125
|
caches
|
126
126
|
=> lists status of all the caches & when they were last
|
127
127
|
reloaded. Will show an ! next to records that were fetched
|
128
|
-
with params.
|
128
|
+
with params. Example:
|
129
129
|
|
130
130
|
caches true
|
131
131
|
=> shows params the caches were loaded with
|
132
132
|
|
133
|
+
products.delete_all
|
134
|
+
=> delete all the products in the cache & reload the cache
|
133
135
|
|
134
136
|
|
135
137
|
|
@@ -17,6 +17,12 @@ module ShopifyAPI
|
|
17
17
|
end
|
18
18
|
|
19
19
|
module ShopifyAPI
|
20
|
+
class VariantWithProduct < Base
|
21
|
+
self.prefix = "/admin/"
|
22
|
+
self.element_name = "variant"
|
23
|
+
self.collection_name = "variants"
|
24
|
+
end
|
25
|
+
|
20
26
|
class << self
|
21
27
|
|
22
28
|
def cache_status(cache, show_opts=false)
|
@@ -84,7 +90,12 @@ EOF
|
|
84
90
|
self.replace(entity.find(:all, params: self.params))
|
85
91
|
self.since = Time.now
|
86
92
|
puts "#{self.length} records."
|
87
|
-
|
93
|
+
self
|
94
|
+
}}
|
95
|
+
obj.singleton_class.class_eval{define_method(:delete_all) {
|
96
|
+
puts "deleting all #{entity.collection_name}..."
|
97
|
+
self.each{|e| entity.delete(e.id)}
|
98
|
+
self.r
|
88
99
|
}}
|
89
100
|
end
|
90
101
|
|
@@ -124,7 +135,7 @@ EOF
|
|
124
135
|
def variants(opts={limit: 250})
|
125
136
|
return if warn_site
|
126
137
|
@@variants ||= nil
|
127
|
-
@@variants = fetch_cache(ShopifyAPI::
|
138
|
+
@@variants = fetch_cache(ShopifyAPI::VariantWithProduct, opts, @@variants)
|
128
139
|
@@variants
|
129
140
|
|
130
141
|
end
|
data/lib/shopifydev/version.rb
CHANGED