i am getting error when execute Apartment::Tenant.switch!("tenant_name") even when the tenant were exists.
When i run Apartment::tenant_names,it return an array contain ["murah5","rahmatullah","test"] then i run Apartment::Tenant.switch!("murah5") it return :
Apartment::TenantNotFound: One of the following schema(s) is invalid: "murah5" "public" from /Users/fourtyonestudio/.rvm/gems/ruby-2.4.1/gems/apartment-1.2.0/lib/apartment/adapters/postgresql_adapter.rb:72:inrescue in connect_to_new'`
can you help me with this case ?
you can make a method in the model (which creates the tenants)
then you can switch your subdomain from rails console like
check you current subdomain by
Apartment::Tenant.current