Module: AlsoMigrate::Migrator::InstanceMethods

Defined in:
lib/also_migrate/migrator.rb

Defined Under Namespace

Modules: AlsoMigrate

Instance Method Summary collapse

Instance Method Details

#migrate_with_also_migrateObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/also_migrate/migrator.rb', line 16

def migrate_with_also_migrate
  if ::AlsoMigrate.classes
    ::AlsoMigrate.classes.uniq.each do |klass|
      if klass.respond_to?(:also_migrate_config)
        AlsoMigrate.create_tables(klass)
      end
    end
  end
rescue Exception => e
  puts "AlsoMigrate error: #{e.message}"
  puts e.backtrace.join("\n")
ensure
  migrate_without_also_migrate
end