How can I find out which tenant (schema) is the current one when Apartment was initialized according to request
How to get current tenant when using Appartment gem in multi-tenancy Rails 4
Asked Answered
Apartment::Tenant.current
P. S. Thank you @pa-buisson
Is possible that current is returning always public? –
Diazo
Note that this returns a
String
with the current subdomain, not a Tenant
object. –
Fearsome @Sergiy Seleskyy Is it is possible to get Tenant based on a given record. For example user1 is in tenent1 and user2 is in tenent2. How can I find Tenent of user1 Apartment::Tenant.current(user1) ?? –
North
@North thank you for your question. Unfortunately, I cannot help you now. 8 years have passed since I had been working with that domain. –
Limoges
© 2022 - 2024 — McMap. All rights reserved.
Apartment::Database
seems to be deprecated now. Instead, you can now useApartment::Tenant.current
. – Beryllium