Limit visibility per tenant
This commit is contained in:
parent
ef573c5f73
commit
3fca449461
@ -1,6 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
set_current_tenant_through_filter
|
||||
before_action :set_tenant
|
||||
before_action :authenticate_user!
|
||||
after_action :set_csrf_cookie
|
||||
@ -47,7 +48,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def set_tenant
|
||||
ActsAsTenant.current_tenant = Wedding.find_by(slug: params[:slug])
|
||||
set_current_tenant(Wedding.find_by!(slug: params[:slug]))
|
||||
end
|
||||
|
||||
def development_swagger?
|
||||
|
@ -9,9 +9,10 @@ ActsAsTenant.without_tenant do
|
||||
Group.delete_all
|
||||
|
||||
Wedding.delete_all
|
||||
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
|
||||
end
|
||||
|
||||
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
|
||||
|
||||
ActsAsTenant.with_tenant(wedding) do
|
||||
Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')
|
||||
Expense.create!(name: 'Country house', amount: 6000, pricing_type: 'fixed')
|
||||
|
Loading…
x
Reference in New Issue
Block a user