rawgento_db 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 711087d1d0e6e4a0fdae0a2ef23ac9d204287114
4
- data.tar.gz: 8660580fd3e5f39452acfbbbb0c199cbfa1a121a
3
+ metadata.gz: 42a8499a9d74a242ecb3ebc681bd9ef9d25c2eb0
4
+ data.tar.gz: 73b829ce4f69600463080db5eb514e9bf36f483c
5
5
  SHA512:
6
- metadata.gz: 4e183f10469c3fb7420c951f8deae06d43aadc655fe0ab0e1a713efb94d817c0c77071d88039fef9ee0b979a97bab6210f7eca4aa24ae2aa53fbc80036f5fa82
7
- data.tar.gz: 51553fedbd57eb6394b266df531d8b19d63bb9e27b7e5ae467edd114e93fc159b13db72270b379b29a4a03cbda91e0531c2a62cf991e375334f748a64710a454
6
+ metadata.gz: f0ae5fecb54f19a25f234119e5e1d7b25210847716ec27fafc6adf6dce7499d49cea4931386493dba9c8777cb52452228b8ef836fc50c999554b80654e4205a5
7
+ data.tar.gz: 1c733a661c0e469c02345fba0a6644a8288daf0f92f16f97d82bcd4312d00e787091b29413953387c25dabf46b23a64ecfc0162bda9a5c0ba30c287e939d782c
@@ -56,12 +56,22 @@ module RawgentoDB
56
56
  "WHERE product_id = %d" % [stock_addition, product_id])
57
57
  end
58
58
 
59
+ #def self.update_stock product_stock, settings=RawgentoDB.settings
60
+ # results = client(settings).query()
61
+ # # UPDATE cataloginventory_stock_item SET qty = CASE
62
+ # # WHEN id = 1 THEN qty + f
63
+ # # WHEN id = 2 THEN ‘War and Peace’
64
+ # # ...
65
+ # # END
66
+ # # WHERE id IN (1,2,...)
67
+ #end
68
+
59
69
  # One-way ticket: Do set available if qty > 0 (but not unavailable if <= 0).
60
70
  def self.set_available_on_stock product_id, settings=RawgentoDB.settings
61
71
  result = client(settings).query(
62
72
  "SELECT is_in_stock FROM cataloginventory_stock_item "\
63
73
  "WHERE product_id = %d AND is_in_stock = 0 AND qty > 0" % product_id)
64
- if result && result.size > 0 && result[0] == 0
74
+ if result && result.size > 0 #&& result[0] == 0
65
75
  result = client(settings).query(
66
76
  "UPDATE cataloginventory_stock_item SET is_in_stock = 1 "\
67
77
  "WHERE product_id = %d" % product_id)
@@ -1,3 +1,3 @@
1
1
  module RawgentoDB
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rawgento_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Wolfsteller