Class: TenantLevelSecurity::TenantContext

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
lib/activerecord-tenant-level-security/tenant_level_security.rb

Instance Method Summary collapse

Instance Method Details

#tenant_id=(val) ⇒ Object



7
8
9
10
# File 'lib/activerecord-tenant-level-security/tenant_level_security.rb', line 7

def tenant_id=(val)
  super
  TenantLevelSecurity.switch_with_connection!(ActiveRecord::Base.connection, val)
end