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 +4 -4
- data/lib/product_home_template/version.rb +1 -1
- data/lib/product_home_template.rb +10 -6
- data/product_home_template.gemspec +0 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cabcb7dea0dd4d8439559f0f818245f5a35e5a2
|
4
|
+
data.tar.gz: 3a9b44d488713518b55ef44d3fd27e2fa64f5c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0600840c5e31e0aa992e37eefd3af0cdd3813aa1b9dd313da388cb12193f8ad795f13713e22b0e7ca889921b8a7c0ccfd366551d5cacd491f59958a3e5a5a441'
|
7
|
+
data.tar.gz: 68713917b6e57a587ecb23ec318541456d7075387a7ff41f8b7cd11307324c0ef62d5473687db2c7cc637f716d67ae2236ac4f39a71b25753f74ee2a84bee824
|
@@ -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
|
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
|
-
|
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
|
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
|
-
|
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.
|
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-
|
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:
|
56
|
-
ranking of the product and normal order
|
55
|
+
description:
|
57
56
|
email:
|
58
57
|
- x16103602@student.ncirl.ie
|
59
58
|
executables: []
|