mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:05:20 +08:00
15 lines
361 B
Ruby
15 lines
361 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class PostAlert < ::Jobs::Base
|
|
def execute(args)
|
|
post = Post.find_by(id: args[:post_id])
|
|
if post&.topic && post.raw.present?
|
|
opts = args[:options] || {}
|
|
new_record = true == args[:new_record]
|
|
PostAlerter.new(opts).after_save_post(post, new_record)
|
|
end
|
|
end
|
|
end
|
|
end
|