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

@@ -468,6 +468,10 @@ class User < ApplicationRecord
(is_moderator? && flag.not_uploaded_by?(id)) || flag.creator_id == id
end
def new_upload_limit
@new_upload_limit ||= UploadLimit.new(self)
end
def upload_limit
[max_upload_limit - used_upload_slots, 0].max
end