Permalink
Browse files

Item score fixes

  • Loading branch information...
1 parent 3883f48 commit 897ae6ea1960dfeabf10944546124b97190e6ae4 @chewbranca chewbranca committed Jan 25, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 app/sweepers/newscloud_sweeper.rb
  2. +1 −1 lib/acts_as_moderatable.rb
View
4 app/sweepers/newscloud_sweeper.rb
@@ -17,8 +17,8 @@ def self.expire_class klass, namespace = nil
if keys.any?
$redis.sunion(*(keys)).each do |key_name|
if key_name =~ /^view_object:([0-9]+)$/
- view_object = ViewObject.find($1)
- view_object.uncache_deps
+ view_object = ViewObject.find_by_id($1)
+ view_object.uncache_deps if view_object
end
end
end
View
2 lib/acts_as_moderatable.rb
@@ -29,7 +29,7 @@ def acts_as_moderatable
module InstanceMethods
def rescore_item
- ItemScore.find_or_create_and_score self
+ ItemScore.find_or_create_and_score self if self.class.rankable_classes.include?(self.class)
end
def moderatable?

0 comments on commit 897ae6e

Please sign in to comment.