discourse/app/jobs/regular/update_topic_upload_security.rb
Martin Brennan 1b3b0708c0
FEATURE: Update upload security status on post move, topic conversion, category change ()
Add TopicUploadSecurityManager to handle post moves. When a post moves around or a topic changes between categories and public/private message status the uploads connected to posts in the topic need to have their secure status updated, depending on the security context the topic now lives in.
2020-01-23 12:01:10 +10:00

17 lines
382 B
Ruby

# frozen_string_literal: true
module Jobs
class UpdateTopicUploadSecurity < ::Jobs::Base
def execute(args)
topic = Topic.find_by(id: args[:topic_id])
if topic.blank?
Rails.logger.info("Could not find topic #{args[:topic_id]} for topic upload security updater.")
return
end
TopicUploadSecurityManager.new(topic).run
end
end
end