2015-04-20 13:34:57 -04:00
|
|
|
module Jobs
|
|
|
|
class PostAlert < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
2015-05-05 20:44:45 -04:00
|
|
|
# maybe it was removed by the time we are making the post
|
|
|
|
if post = Post.find_by(id: args[:post_id])
|
2015-05-05 23:25:23 -04:00
|
|
|
# maybe the topic was deleted, so skip in that case as well
|
|
|
|
PostAlerter.post_created(post) if post.topic
|
2015-05-05 20:44:45 -04:00
|
|
|
end
|
2015-04-20 13:34:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|