Class: Apartment::Adapters::PostgresqlSchemaAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- Apartment::Adapters::PostgresqlSchemaAdapter
- Defined in:
- lib/apartment/adapters/postgresql_adapter.rb
Overview
Separate Adapter for Postgresql when using schemas
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from AbstractAdapter
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize(config) ⇒ PostgresqlSchemaAdapter
constructor
A new instance of PostgresqlSchemaAdapter.
-
#reset ⇒ Object
Reset schema search path to the default schema_search_path.
Methods inherited from AbstractAdapter
#create, #drop, #each, #environmentify, #process_excluded_models, #seed_data, #switch, #switch!
Constructor Details
#initialize(config) ⇒ PostgresqlSchemaAdapter
Returns a new instance of PostgresqlSchemaAdapter.
28 29 30 31 32 |
# File 'lib/apartment/adapters/postgresql_adapter.rb', line 28 def initialize(config) super reset end |
Instance Method Details
#current ⇒ Object
43 44 45 |
# File 'lib/apartment/adapters/postgresql_adapter.rb', line 43 def current @current || default_tenant end |
#reset ⇒ Object
Reset schema search path to the default schema_search_path
@return {String} default schema search path
38 39 40 41 |
# File 'lib/apartment/adapters/postgresql_adapter.rb', line 38 def reset @current = default_tenant Apartment.connection.schema_search_path = full_search_path end |