cf10dbd91e
Re-applies the storage limit from #2713 (reverted in #2715) with an exception for staff identities so our own account isn't blocked.
15 lines
340 B
Ruby
15 lines
340 B
Ruby
module Account::StorageLimited
|
|
extend ActiveSupport::Concern
|
|
|
|
STORAGE_LIMIT = 1.gigabyte
|
|
NEAR_STORAGE_LIMIT_THRESHOLD = 500.megabytes
|
|
|
|
def exceeding_storage_limit?
|
|
bytes_used > STORAGE_LIMIT
|
|
end
|
|
|
|
def nearing_storage_limit?
|
|
!exceeding_storage_limit? && bytes_used > STORAGE_LIMIT - NEAR_STORAGE_LIMIT_THRESHOLD
|
|
end
|
|
end
|