a761d809ae
Limit free storage to 1GB on the SaaS version. When exceeded, card publishing, comment creation, and JSON card creation are blocked, and the card footer shows a "self-host Fizzy for unlimited storage" notice instead of the create buttons. A nearing-limit warning appears when usage exceeds 500MB. Uses the same SaaS engine patterns as the removed billing system: model concern on Account, controller concerns included via config.to_prepare, view partials in saas/ with Fizzy.saas? guards in the main app.
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
|