discourse/app/jobs/regular/post_alert.rb

14 lines
315 B
Ruby
Raw Normal View History

require_dependency 'post_alerter'
2015-04-21 01:34:57 +08:00
module Jobs
class PostAlert < Jobs::Base
def execute(args)
2015-05-06 08:44:45 +08:00
# maybe it was removed by the time we are making the post
post = Post.where(id: args[:post_id]).first
PostAlerter.post_created(post, args[:options] || {}) if post && post.topic
2015-04-21 01:34:57 +08:00
end
end
end