trendable 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/concerns/trendable.rb +12 -4
- data/lib/trendable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 871c3002aa95c0d592834e6dbfdf346166cd2afc
|
4
|
+
data.tar.gz: 05e21e33898ea412c7251e41812e22a4d98cb689
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e83c6d60662b650e6935cb64ef094746e71330e98a172d5f5b35559851753a381bfac4404ff1b64dbe06995d602b9d2a741f673fb37339869ac531c0dc01596
|
7
|
+
data.tar.gz: 522680533ef03bf913b77d857ad4e96eb9b781405f52010186e31aa7b6a352e29d69131ef9fcefad982058292381374fd2b8427eb5084fdd3a873f9600901f8d
|
data/lib/concerns/trendable.rb
CHANGED
@@ -12,12 +12,20 @@ module Trendable
|
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
|
-
def boost_trending_power!( add_value = 1000 )
|
16
|
-
|
15
|
+
def boost_trending_power!( add_value = 1000, dont_touch: false )
|
16
|
+
if dont_touch
|
17
|
+
self.update_columns( trending_power: trending_power + add_value )
|
18
|
+
else
|
19
|
+
self.update_attributes( trending_power: trending_power + add_value )
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
|
-
def fade_out_trending_power!( multiplier = 0.9 )
|
20
|
-
|
23
|
+
def fade_out_trending_power!( multiplier = 0.9, dont_touch: false )
|
24
|
+
if dont_touch
|
25
|
+
self.update_columns( trending_power: trending_power * multiplier )
|
26
|
+
else
|
27
|
+
self.update_attributes( trending_power: trending_power * multiplier )
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
data/lib/trendable/version.rb
CHANGED