Files
fizzy/saas/app/models/account/storage_limited.rb
T
Jorge Manrubia cf10dbd91e Add 1GB storage cap with staff bypass (#2729)
Re-applies the storage limit from #2713 (reverted in #2715) with an
exception for staff identities so our own account isn't blocked.
2026-03-19 12:38:39 +01:00

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