Permalink
Browse files

Use paginated_each since find_each/find_in_batches is buggy & bombing…

… out.
  • Loading branch information...
1 parent eba5477 commit 31047f0e580d9647b9d1ce5815343e4b3f713288 @sudara committed Sep 23, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/asset/statistics.rb
View
2 app/models/asset/statistics.rb
@@ -27,7 +27,7 @@ def self.gigs
end
def self.update_hotness
- Asset.find_each do |a|
+ Asset.paginated_each do |a| # for some reason find_each doesn't work here...
# These use update_all so that they do not trigger callbacks and invalidate cache
Asset.update_all "hotness = #{a.calculate_hotness}", "id = #{a.id}"
Asset.update_all "listens_per_week = #{a.listens_per_week}", "id = #{a.id}"

0 comments on commit 31047f0

Please sign in to comment.