Add 1GB storage limit with self-host notice for SaaS
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.
This commit is contained in:
@@ -133,10 +133,14 @@ module Fizzy
|
||||
end
|
||||
|
||||
config.to_prepare do
|
||||
::Account.include Account::StorageLimited
|
||||
::Identity.include Authorization::Identity, Identity::Devices
|
||||
::Session.include Session::Devices
|
||||
::Signup.prepend Signup
|
||||
ApplicationController.include Authorization::Controller
|
||||
CardsController.include(Card::StorageLimited::Creation)
|
||||
Cards::CommentsController.include(Card::StorageLimited::Commenting)
|
||||
Cards::PublishesController.include(Card::StorageLimited::Publishing)
|
||||
|
||||
Notification.register_push_target(:native)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user