Module: Composable::Tenant
- Defined in:
- lib/composable/tenant.rb,
lib/composable/tenant/errors.rb,
lib/composable/tenant/version.rb,
lib/composable/tenant/data_set.rb,
lib/composable/tenant/gem_version.rb,
lib/composable/tenant/model_extensions.rb
Defined Under Namespace
Modules: ModelExtensions, VERSION Classes: DataSet, Error, NoTenantSet, TenantIsImmutable
Class Method Summary collapse
-
.gem_version ⇒ Object
Returns the currently-loaded version of Composable::Tenant as a
Gem::Version. - .set_tenant(tenant, record) ⇒ Object
-
.version ⇒ Object
Returns the currently-loaded version of Composable::Tenant as a
Gem::Version. - .without_tenant(*tenants) ⇒ Object
Class Method Details
.gem_version ⇒ Object
Returns the currently-loaded version of Composable::Tenant as a Gem::Version.
6 7 8 |
# File 'lib/composable/tenant/gem_version.rb', line 6 def self.gem_version Gem::Version.new VERSION::STRING end |
.set_tenant(tenant, record) ⇒ Object
11 12 13 14 |
# File 'lib/composable/tenant/model_extensions.rb', line 11 def self.set_tenant(tenant, record) Composable::Tenant::DataSet.tenant = [tenant, record] record end |
.version ⇒ Object
Returns the currently-loaded version of Composable::Tenant as a Gem::Version.
8 9 10 |
# File 'lib/composable/tenant/version.rb', line 8 def self.version gem_version end |
.without_tenant(*tenants) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/composable/tenant/model_extensions.rb', line 3 def self.without_tenant(*tenants) old_excluded_tenants = Composable::Tenant::DataSet.excluded_tenants Composable::Tenant::DataSet.excluded_tenants = Set.new(tenants.map(&:to_sym)) yield ensure Composable::Tenant::DataSet.excluded_tenants = old_excluded_tenants end |