Class: Combustion::Database::Migrate

Inherits:
Object
  • Object
show all
Defined in:
lib/combustion/database/migrate.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callObject



4
5
6
# File 'lib/combustion/database/migrate.rb', line 4

def self.call
  new.call
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/combustion/database/migrate.rb', line 8

def call
  ar_gate = Combustion::VersionGate.new("activerecord")

  if ar_gate.call(">= 5.2")
    migration_context.migrate
  elsif ar_gate.call(">= 3.1")
    migrator.migrate paths, nil
  else
    paths.each { |path| migrator.migrate path, nil }
  end
end