2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-20 13:34:57 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class PostAlert < ::Jobs::Base
|
2015-04-20 13:34:57 -04:00
|
|
|
def execute(args)
|
2018-05-24 11:27:43 -04:00
|
|
|
post = Post.find_by(id: args[:post_id])
|
2019-03-15 12:58:43 -04:00
|
|
|
if post&.topic && post.raw.present?
|
2018-05-24 11:27:43 -04:00
|
|
|
opts = args[:options] || {}
|
|
|
|
new_record = true == args[:new_record]
|
|
|
|
PostAlerter.new(opts).after_save_post(post, new_record)
|
|
|
|
end
|
2015-04-20 13:34:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|