Module: Octopus::Migration

Defined in:
lib/octopus/migration.rb

Instance Method Summary collapse

Instance Method Details

#using(*args, &block) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/octopus/migration.rb', line 2

def using(*args, &block)
  if args.size == 1
    self.connection().block = true
    self.connection().current_shard = args.first
  else
    self.connection().current_shard = args        
  end
  
  yield if block_given?

  return self
end

#using_group(*args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/octopus/migration.rb', line 15

def using_group(*args)
  if args.size == 1
    self.connection().block = true
    self.connection().current_group = args.first
  else
    self.connection().current_group = args
  end

  return self
end