user where as opposed to find to compensate for deleted topics

This commit is contained in:
Sam
2013-07-05 15:21:04 +10:00
parent 0c702522c4
commit 50767be722
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -2,9 +2,9 @@ module Jobs
class CloseTopic < Jobs::Base
def execute(args)
topic = Topic.find(args[:topic_id])
topic = Topic.where(id: args[:topic_id]).first
if topic and topic.auto_close_at and !topic.closed? and !topic.deleted_at
closer = User.find(args[:user_id])
closer = User.where(id: args[:user_id]).first
if Guardian.new(closer).can_moderate?(topic)
topic.update_status('autoclosed', true, closer)
end