product_update_single 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13062840871c5762c1dbf64b42f60aec627460a3
4
- data.tar.gz: 4807e57c0b0701b4ea742b2abcf318f632a1db31
3
+ metadata.gz: 34279169d49c00c21b86a4677e14e5d30e53c55b
4
+ data.tar.gz: f643768a33bbb8f6ed8066e77eabb0d19c5d120e
5
5
  SHA512:
6
- metadata.gz: 29388a8f5a2b142953e3a9b0d0dc3e3e7183be88123cdabb821339b261b754c535285c75b1080f435859c6c605140eca913846a910da83653eb09e1b51aff7ee
7
- data.tar.gz: 910ff12039647638a0685e8d7f0bd9a6c7b32619b4ab32dbf0641954842627d79492949232ce55d35b95d4c45b36d2a51ce9f913e06842bc5489d351cb299e4e
6
+ metadata.gz: 28eb1eea0f226a989fc8c0c34aafadd18bce9e2d074a3b0ff68de1f8a4363b87ef797d4fadf5040c74b980574a33f823c2136a7a115cd586ff7551d2da022d80
7
+ data.tar.gz: 599728471c06dddef72a4efdcefe81b21e0b8de4af783a5f933ac4fe99965c003375e02ae4fe4e486fa53bf645dbf860cbb762f1e89f3aa542c6e80cdc15096c
@@ -1,3 +1,3 @@
1
1
  module ProductUpdateSingle
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require "product_update_single/version"
2
-
2
+ #This is a singleton class which performs the ranking and count update of the products based on every order is confirmed
3
3
  require 'singleton'
4
4
  class ProductUpdateSingleton
5
5
  include Singleton
@@ -29,7 +29,8 @@ class ProductUpdateSingleton
29
29
  @product_hit_update.quantityAvailable -= @order_record.quantity
30
30
  @product_hit_update.save
31
31
  end
32
-
32
+
33
+ #this method updates the count column in the product model based on the quantity of products sold.
33
34
  def count_update
34
35
  @order_confirmed = Order.last
35
36
  @order_record = OrderItem.where(order_id: @order_confirmed.id)
@@ -50,6 +51,7 @@ class ProductUpdateSingleton
50
51
  self.hit_counter
51
52
  end
52
53
 
54
+ #this method is triggered by the count update method internally to rank the products by its count updated previously.
53
55
  def hit_counter
54
56
  @count_iterate = 1
55
57
  @prod = Product.all
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: product_update_single
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kishore Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2017-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler