uploads: replace old upload limits with new upload limits.

This commit is contained in:
evazion
2020-02-03 18:37:14 -06:00
parent 24cb920608
commit 3c2a379d6f
20 changed files with 67 additions and 158 deletions

View File

@@ -11,7 +11,23 @@ class UploadLimit
end
def limited?
used_upload_slots >= upload_slots
if user.can_upload_free?
false
elsif user.created_at > 1.week.ago
true
else
used_upload_slots >= upload_slots
end
end
def limit_reason
if user.created_at > 1.week.ago
"cannot upload during your first week of registration"
elsif limited?
"have reached your upload limit"
else
nil
end
end
def used_upload_slots