Class: PostgresMultitenant::TenantSchemaLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/postgres_multitenant/tenant_schema_loader.rb

Overview

Loads tenant schemas without using eval on regex-extracted fragments.

Class Method Summary collapse

Class Method Details

.load_into_current_schemaObject



7
8
9
10
11
12
13
14
15
# File 'lib/postgres_multitenant/tenant_schema_loader.rb', line 7

def load_into_current_schema
  schema_file = tenant_schema_file
  return unless schema_file

  load_full_schema_file(schema_file)
  prune_non_tenant_tables! unless schema_file.basename.to_s == 'tenant_schema.rb'

  
end