diff --git a/config/initializers/acts_as_tenant.rb b/config/initializers/acts_as_tenant.rb new file mode 100644 index 0000000..2813ace --- /dev/null +++ b/config/initializers/acts_as_tenant.rb @@ -0,0 +1,3 @@ +ActsAsTenant.configure do |config| + config.require_tenant = true +end \ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index e493f6b..e0a11a6 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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')