Module: Octopus::Migration::ClassMethods
- Includes:
- InstanceOrClassMethods
- Defined in:
- lib/octopus/migration.rb
Instance Method Summary collapse
Methods included from InstanceOrClassMethods
#announce_with_octopus, #get_current_shard
Instance Method Details
#shards ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/octopus/migration.rb', line 51 def shards shards = Set.new if groups = current_group Array.wrap(groups).each do |group| group_shards = connection.shards_for_group(group) shards.merge(group_shards) if group_shards end elsif shard = current_shard shards.merge(Array.wrap(shard)) end shards.to_a.presence || [:master] end |