product_update_single 0.1.2 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d56b2ec857b55f0633bd235ec8f4275dd6c10773
4
- data.tar.gz: 203a487f3d2e6ee552dfd70fe60f394283232237
3
+ metadata.gz: 13062840871c5762c1dbf64b42f60aec627460a3
4
+ data.tar.gz: 4807e57c0b0701b4ea742b2abcf318f632a1db31
5
5
  SHA512:
6
- metadata.gz: 73c580520f0b9d803fc806134f98574fabadd82d5fe05deaa2f10d51c3d779fb8748291a03447267e056a967122e0c9f634f7f47776bce57aae626a35073b60e
7
- data.tar.gz: e8302b79b08269078cdbf6e8ea5c1e52a19903fcf11ca6f9d3d651e6cba12b7aa9d54f6a0942dad8feef8927b9922452f515fd908c31dfc11c73cd7fc16314c4
6
+ metadata.gz: 29388a8f5a2b142953e3a9b0d0dc3e3e7183be88123cdabb821339b261b754c535285c75b1080f435859c6c605140eca913846a910da83653eb09e1b51aff7ee
7
+ data.tar.gz: 910ff12039647638a0685e8d7f0bd9a6c7b32619b4ab32dbf0641954842627d79492949232ce55d35b95d4c45b36d2a51ce9f913e06842bc5489d351cb299e4e
@@ -1,3 +1,3 @@
1
1
  module ProductUpdateSingle
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -35,9 +35,15 @@ class ProductUpdateSingleton
35
35
  @order_record = OrderItem.where(order_id: @order_confirmed.id)
36
36
  @order_record.each do |order_record|
37
37
  @product_count_update = Product.find(order_record.product_id)
38
+ if(@product_count_update.count?)
39
+ puts(@product_count_update)
40
+ @product_count_update.count += order_record.quantity
41
+ else
42
+ @product_count_update.count = 0
43
+ @product_count_update.count += order_record.quantity
44
+ end
38
45
  puts("inside count update function and order item should have been initiated by now")
39
- @product_count_update.count += order_record.quantity
40
- @product_count_update.quantityAvailable -= order_record.quantity
46
+ #@product_count_update.quantityAvailable -= order_record.quantity
41
47
  @product_count_update.save
42
48
  end
43
49
  puts("count update should be completed by now and quantity of product ordered should be have been subtracted in the product")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: product_update_single
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kishore Kumar