mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add billing (#329)
This commit is contained in:
committed by
GitHub
parent
fc36c967af
commit
bea146e612
@@ -35,6 +35,7 @@ class ApplicationController < ActionController::Base
|
||||
# Load tenant data
|
||||
@tenant = Current.tenant_or_raise!
|
||||
@tenant_setting = TenantSetting.first_or_create
|
||||
@tenant_billing = TenantBilling.first_or_create
|
||||
@boards = Board.select(:id, :name, :slug).order(order: :asc)
|
||||
|
||||
# Setup locale
|
||||
@@ -48,6 +49,14 @@ class ApplicationController < ActionController::Base
|
||||
.order(created_at: :asc)
|
||||
end
|
||||
|
||||
def check_tenant_subscription
|
||||
return if Current.tenant.tenant_billing.has_active_subscription?
|
||||
|
||||
render json: {
|
||||
error: 'Your subscription has expired. Please renew it to continue using the service.'
|
||||
}, status: :forbidden
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user_not_authorized
|
||||
|
||||
Reference in New Issue
Block a user