Module: ActiveRecord::Turntable::Migration::OverrideMethods
- Defined in:
- lib/active_record/turntable/migration.rb
Instance Method Summary collapse
Instance Method Details
#announce(message) ⇒ Object
37 38 39 |
# File 'lib/active_record/turntable/migration.rb', line 37 def announce() super("#{} - Shard: #{current_shard}") end |
#exec_migration(*args) ⇒ Object
41 42 43 |
# File 'lib/active_record/turntable/migration.rb', line 41 def exec_migration(*args) super(*args) if target_shard?(current_shard) end |
#target_shard?(shard_name) ⇒ Boolean
45 46 47 |
# File 'lib/active_record/turntable/migration.rb', line 45 def target_shard?(shard_name) target_shards.blank? or target_shards.include?(shard_name) end |