Class: Hippo::Tenant
- Defined in:
- lib/hippo/tenant.rb
Overview
Tenant
Constant Summary
Constants included from Concerns::ApiAttributeAccess
Concerns::ApiAttributeAccess::DEFAULT_BLACKLISTED
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
belongs_to_tenant, scoped_by_tenant?
Methods included from Concerns::ApiAttributeAccess
#_set_attribute_data_from_collection, #set_attribute_data, #setting_attribute_is_allowed?
Class Method Details
.current ⇒ Object
25 26 27 |
# File 'lib/hippo/tenant.rb', line 25 def self.current MultiTenant.current_tenant end |
.switch(condition) ⇒ Object
36 37 38 |
# File 'lib/hippo/tenant.rb', line 36 def self.switch(condition) MultiTenant.current_tenant = self.find_by(condition) end |
.system ⇒ Object
29 30 31 32 33 34 |
# File 'lib/hippo/tenant.rb', line 29 def self.system find_by(slug: 'system') || create!( slug: 'system', name: 'system', email: '[email protected]', subscription: :admin ) end |