Class: MultitenancyTools::SchemaDestroyer
- Inherits:
-
Object
- Object
- MultitenancyTools::SchemaDestroyer
- Defined in:
- lib/multitenancy_tools/schema_destroyer.rb
Overview
SchemaDestroyer can be used to destroy a PostgreSQL schema.
Instance Method Summary collapse
-
#destroy ⇒ Object
Drops the schema.
-
#initialize(schema, connection = ActiveRecord::Base.connection) ⇒ SchemaDestroyer
constructor
A new instance of SchemaDestroyer.
Constructor Details
#initialize(schema, connection = ActiveRecord::Base.connection) ⇒ SchemaDestroyer
Returns a new instance of SchemaDestroyer.
10 11 12 13 |
# File 'lib/multitenancy_tools/schema_destroyer.rb', line 10 def initialize(schema, connection = ActiveRecord::Base.connection) @connection = connection @schema = @connection.quote_table_name(schema) end |
Instance Method Details
#destroy ⇒ Object
Drops the schema.
16 17 18 |
# File 'lib/multitenancy_tools/schema_destroyer.rb', line 16 def destroy @connection.drop_schema(@schema) end |