Module: Switchman::ActiveRecord::Migration
- Defined in:
- lib/switchman/active_record/migration.rb
Defined Under Namespace
Modules: Compatibility
Instance Method Summary collapse
Instance Method Details
#connection ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/switchman/active_record/migration.rb', line 21 def connection conn = super if conn.shard != ::ActiveRecord::Base.connection_pool.current_pool.shard ::ActiveRecord::Base.connection_pool.current_pool.switch_database(conn) end conn end |