Require a tenant to be configured for all queries

This commit is contained in:
Manuel Bustillo 2024-12-02 08:57:10 +01:00
parent 822b2b0fad
commit ef573c5f73
2 changed files with 12 additions and 7 deletions

View File

@ -0,0 +1,3 @@
ActsAsTenant.configure do |config|
config.require_tenant = true
end

View File

@ -2,13 +2,15 @@
NUMBER_OF_GUESTS = 50
TablesArrangement.delete_all
Expense.delete_all
Guest.delete_all
Group.delete_all
Wedding.delete_all
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
ActsAsTenant.without_tenant do
TablesArrangement.delete_all
Expense.delete_all
Guest.delete_all
Group.delete_all
Wedding.delete_all
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
end
ActsAsTenant.with_tenant(wedding) do
Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')