Require a tenant to be configured for all queries
This commit is contained in:
parent
822b2b0fad
commit
ef573c5f73
3
config/initializers/acts_as_tenant.rb
Normal file
3
config/initializers/acts_as_tenant.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ActsAsTenant.configure do |config|
|
||||||
|
config.require_tenant = true
|
||||||
|
end
|
14
db/seeds.rb
14
db/seeds.rb
@ -2,13 +2,15 @@
|
|||||||
|
|
||||||
NUMBER_OF_GUESTS = 50
|
NUMBER_OF_GUESTS = 50
|
||||||
|
|
||||||
TablesArrangement.delete_all
|
ActsAsTenant.without_tenant do
|
||||||
Expense.delete_all
|
TablesArrangement.delete_all
|
||||||
Guest.delete_all
|
Expense.delete_all
|
||||||
Group.delete_all
|
Guest.delete_all
|
||||||
|
Group.delete_all
|
||||||
|
|
||||||
Wedding.delete_all
|
Wedding.delete_all
|
||||||
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
|
wedding = Wedding.create!(slug: :default, date: 1.year.from_now)
|
||||||
|
end
|
||||||
|
|
||||||
ActsAsTenant.with_tenant(wedding) do
|
ActsAsTenant.with_tenant(wedding) do
|
||||||
Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')
|
Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user