module PgPower::ConnectionAdapters::AbstractAdapter::SchemaMethods
Extends ActiveRecord::ConnectionAdapters::AbstractAdapter with methods for multi-schema support.
Public Instance Methods
create_table_with_schema_option(table_name, options = {}, &block)
click to toggle source
Provide :schema option to create_table
method.
# File lib/pg_power/connection_adapters/abstract_adapter/schema_methods.rb, line 6 def create_table_with_schema_option(table_name, options = {}, &block) options = options.dup schema_name = options.delete(:schema) table_name = "#{schema_name}.#{table_name}" if schema_name create_table_without_schema_option(table_name, options, &block) end
drop_table_with_schema_option(table_name, options = {})
click to toggle source
Provide :schema option to drop_table
method.
# File lib/pg_power/connection_adapters/abstract_adapter/schema_methods.rb, line 14 def drop_table_with_schema_option(table_name, options = {}) options = options.dup schema_name = options.delete(:schema) table_name = "#{schema_name}.#{table_name}" if schema_name drop_table_without_schema_option(table_name, options) end