trendable 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trendable/version.rb +1 -1
- data/lib/workers/fade_out_trend_power_worker.rb +2 -2
- 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: 46f180c8e8596a86a6012cb26169de159d18364b
|
4
|
+
data.tar.gz: 31f097bf8a8655bcc72be47ae575df04e0bf23cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfaaeacc4d8d6c61425351604f53769d225c24a692a0b90e1e88b1b2570ca5ffc3b23b8e09d2a853ceaf7537f69d21bf4e1c75cbf8111ce3586d1a220451c002
|
7
|
+
data.tar.gz: 5263b37866e85594d8e04aadfd2cc5d0694aef628a8a5ba277e1ac58577743a80f40204496204a17b907f06eab10c2d332225e93dd21b08837d486b851eb641c
|
data/lib/trendable/version.rb
CHANGED
@@ -7,8 +7,8 @@ class FadeOutTrendPowerWorker
|
|
7
7
|
ActiveRecord::Base.descendants.each do |klass|
|
8
8
|
if klass.respond_to?( "has_trendable_concern?".to_sym )
|
9
9
|
|
10
|
-
klass.items_to_fade_trending_power.find_in_batches( batch_size: batch_size ) do |batch|
|
11
|
-
batch.update_all( "trending_power = trending_power * #{multiplier}")
|
10
|
+
klass.items_to_fade_trending_power.select( :id ).find_in_batches( batch_size: batch_size ) do |batch|
|
11
|
+
klass.where( id: batch.collect{ |i| i.id } ).update_all( "trending_power = trending_power * #{multiplier}")
|
12
12
|
end
|
13
13
|
else
|
14
14
|
puts "#{klass.to_s} does not have trendable concern"
|