Class: Multitenant::Mysql::Tenant
- Inherits:
-
Object
- Object
- Multitenant::Mysql::Tenant
- Defined in:
- lib/multitenant-mysql/connection_switcher.rb
Class Method Summary collapse
Class Method Details
.exists?(tenant_name) ⇒ Boolean
6 7 8 9 10 11 12 13 14 |
# File 'lib/multitenant-mysql/connection_switcher.rb', line 6 def self.exists? tenant_name return true if tenant_name.blank? tenant = Multitenant::Mysql.configs.tenant field = Multitenant::Mysql.configs.bucket.field if tenant.where(field => tenant_name).blank? raise NoTenantRegistratedError.new("No tenant registered: #{tenant_name}") end true end |