Module: Switchman::ActiveRecord::Migration
- Defined in:
- lib/switchman/active_record/migration.rb
Instance Method Summary collapse
Instance Method Details
#connection ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/switchman/active_record/migration.rb', line 4 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 |