FIX: PostAlerter should ignore deleted posts
This commit is contained in:
parent
734c272de8
commit
971af6a762
|
@ -3,10 +3,8 @@ module Jobs
|
||||||
|
|
||||||
def execute(args)
|
def execute(args)
|
||||||
# maybe it was removed by the time we are making the post
|
# maybe it was removed by the time we are making the post
|
||||||
if post = Post.find(args[:post_id])
|
post = Post.where(id: args[:post_id]).first
|
||||||
# maybe the topic was deleted, so skip in that case as well
|
PostAlerter.post_created(post) if post && post.topic
|
||||||
PostAlerter.post_created(post) if post.topic
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue