mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REVERT: DEV: should ignore missing post uploads when a user export destroyed
Reverts793915fe6a. We no longer need this since we're destroying each posts in commit028121b95b.
This commit is contained in:
@@ -5,16 +5,8 @@ class UserExport < ActiveRecord::Base
|
||||
belongs_to :upload, dependent: :destroy
|
||||
belongs_to :topic, dependent: :destroy
|
||||
|
||||
around_destroy :ignore_missing_post_uploads
|
||||
|
||||
DESTROY_CREATED_BEFORE = 2.days.ago
|
||||
|
||||
def ignore_missing_post_uploads
|
||||
post_ids = upload.post_uploads.pluck(:post_id)
|
||||
yield
|
||||
post_ids.each { |post_id| PostCustomField.create!(post_id: post_id, name: Post::MISSING_UPLOADS_IGNORED, value: "t") }
|
||||
end
|
||||
|
||||
def self.remove_old_exports
|
||||
UserExport.where('created_at < ?', DESTROY_CREATED_BEFORE).find_each do |user_export|
|
||||
UserExport.transaction do
|
||||
|
||||
Reference in New Issue
Block a user