-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActsAsTenant::Errors::NoTenantSet when model has global records #241
Comments
That makes sense to me and does sound like a bug. Anyone using |
In my understanding But it doesn't make sense when we're trying to create global records I will try to reproduce in tests |
test to reproduce this: summary: allow(ActsAsTenant.configuration).to receive_messages(require_tenant: true)
...
ActsAsTenant.current_tenant = nil
...
expect(GlobalProject.new(name: "foo new").valid?).to be(true) error:
failing code:
|
Hi!
We have
config.require_tenant = true
and models withacts_as_tenant(:tenant, has_global_records: true)
. When we're trying to build/create such records in tenantless scope (tenant = nil) we're receivingActsAsTenant::Errors::NoTenantSet
. This is expected and unexpected in the same time :)ActsAsTenant.without_tenant
helps, but I'm wondering if this error should really be raised for models with global records?Thanks.
The text was updated successfully, but these errors were encountered: