Add new upload limit system (fix #4234).

This commit is contained in:
evazion
2020-01-23 18:14:30 -06:00
parent 3d6084338c
commit 18affeb4e9
9 changed files with 196 additions and 3 deletions

View File

@@ -1279,6 +1279,9 @@ class Post < ApplicationRecord
# XXX This must happen *after* the `is_deleted` flag is set to true (issue #3419).
give_favorites_to_parent(options) if options[:move_favorites]
is_automatic = (reason == "Unapproved in three days")
uploader.new_upload_limit.update_limit!(self, incremental: is_automatic)
unless options[:without_mod_action]
ModAction.log("deleted post ##{id}, reason: #{reason}", :post_delete)
end