mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 04:46:00 +08:00
17 lines
344 B
Ruby
17 lines
344 B
Ruby
require_dependency 'post_alerter'
|
|
|
|
module Jobs
|
|
class PostAlert < Jobs::Base
|
|
|
|
def execute(args)
|
|
post = Post.find_by(id: args[:post_id])
|
|
if post&.topic
|
|
opts = args[:options] || {}
|
|
new_record = true == args[:new_record]
|
|
PostAlerter.new(opts).after_save_post(post, new_record)
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|