product_home_template 0.1.5 → 0.1.6

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: c220ad58eb00f85a3789cc48cb0927b8eaed7852
4
- data.tar.gz: 7c0a26c36841786157d07b8b27c7601c70677e19
3
+ metadata.gz: 8cabcb7dea0dd4d8439559f0f818245f5a35e5a2
4
+ data.tar.gz: 3a9b44d488713518b55ef44d3fd27e2fa64f5c81
5
5
  SHA512:
6
- metadata.gz: 79f78ddf6a7f48061d53b8308117050058cc6b77aab32e948dc58967bde9ab7d0bef7d27876919d99bd447230e227dc70c41282665c1ab82e288615a847e790c
7
- data.tar.gz: 41cf7fb40e51a17bd335dc5d34b59185dc5ce555840febe7a4965296384f7c9079bd701a4cfd2aa08ae7f26cd535e5b203c83ca72ea9b8f51a55682571c18fb1
6
+ metadata.gz: '0600840c5e31e0aa992e37eefd3af0cdd3813aa1b9dd313da388cb12193f8ad795f13713e22b0e7ca889921b8a7c0ccfd366551d5cacd491f59958a3e5a5a441'
7
+ data.tar.gz: 68713917b6e57a587ecb23ec318541456d7075387a7ff41f8b7cd11307324c0ef62d5473687db2c7cc637f716d67ae2236ac4f39a71b25753f74ee2a84bee824
@@ -1,3 +1,3 @@
1
1
  module ProductHomeTemplate
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -59,22 +59,26 @@ class CheckByRank < BasicWay
59
59
 
60
60
  #this method to run the logic of sorting the products with pagination by ranking the click history
61
61
  def my_special_method(pages)
62
- @sorted_click = current_member.clicks.order('id desc').select("product_identity").group_by{|o| o.product_identity}.keys.uniq.take(3)
62
+ @sorted_click = current_member.clicks.order('id desc').select("product_identity").group_by{|o| o.product_identity}.keys.uniq
63
63
  @sorted_click.each do |c|
64
- @record_products << @store_detail.products.find(c).paginate(page: pages, per_page: 3).find(c)
64
+ if(@store_detail.products.find(c))
65
+ @record_products << @store_detail.products.find(c).paginate(page: pages, per_page: 3).find(c)
66
+ end
65
67
  end
66
- @record_products
68
+ @record_products.take(3)
67
69
  end
68
70
 
69
71
  #this method to run the logic of sorting the products without pagination by ranking the click history
70
72
  def my_special_method_without(member)
71
- @sorted_click = member.clicks.order('id desc').select("product_identity").group_by{|o| o.product_identity}.keys.uniq.take(3)
73
+ @sorted_click = member.clicks.order('id desc').select("product_identity").group_by{|o| o.product_identity}.keys.uniq
72
74
  @sorted_click.each do |c|
73
- @record_products << @store_detail.products.find(c)
75
+ if(@store_detail.products.find(c))
76
+ @record_products << @store_detail.products.find(c)
77
+ end
74
78
  end
75
79
  puts("=== by rank ===")
76
80
  puts(@record_products)
77
- return @record_products
81
+ return @record_products.take(3)
78
82
  end
79
83
 
80
84
  end
@@ -10,7 +10,6 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["x16103602@student.ncirl.ie"]
11
11
 
12
12
  spec.summary = %q{This gem provides a webpage assist to have the products by click history, ranking of the product and normal order}
13
- spec.description = %q{This gem provides a webpage assist to have the products by click history, ranking of the product and normal order}
14
13
  spec.license = "MIT"
15
14
 
16
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: product_home_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-18 00:00:00.000000000 Z
11
+ date: 2017-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,8 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
- description: This gem provides a webpage assist to have the products by click history,
56
- ranking of the product and normal order
55
+ description:
57
56
  email:
58
57
  - x16103602@student.ncirl.ie
59
58
  executables: []