2017-09-15 01:02:11 -04:00
|
|
|
require_dependency 'post_alerter'
|
|
|
|
|
2015-04-20 13:34:57 -04:00
|
|
|
module Jobs
|
|
|
|
class PostAlert < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
2018-05-24 11:27:43 -04:00
|
|
|
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
|
2015-04-20 13:34:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|