Module: DataMigration

Defined in:
lib/data-migration.rb,
lib/data_migration/job.rb,
lib/data_migration/task.rb,
lib/data_migration/config.rb,
lib/generators/data_migration/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Config, Job, JobConcurrencyLimitError, JobConflictError, Task

Constant Summary collapse

VERSION =
"1.3.0".freeze

Class Method Summary collapse

Class Method Details

.configObject



10
11
12
# File 'lib/data-migration.rb', line 10

def config
  @@config ||= DataMigration::Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



14
15
16
# File 'lib/data-migration.rb', line 14

def configure
  yield config
end

.notify(message, context: {}) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/data-migration.rb', line 18

def notify(message, context: {})
  if Object.const_defined?(:ActionReporter)
    ActionReporter.notify(message, context: context.presence || {})
  elsif Object.const_defined?(:Rails)
    Rails.logger.info("#{message} #{context.inspect}")
  end
end

.perform_laterObject



30
31
32
# File 'lib/data-migration.rb', line 30

def perform_later(...)
  DataMigration::Task.perform_later(...)
end

.perform_nowObject



26
27
28
# File 'lib/data-migration.rb', line 26

def perform_now(...)
  DataMigration::Task.perform_now(...)
end

.prepareObject



34
35
36
# File 'lib/data-migration.rb', line 34

def prepare(...)
  DataMigration::Task.prepare(...)
end

.tasks_table_nameObject



8
9
10
# File 'lib/data_migration/task.rb', line 8

def self.tasks_table_name
  "data_migration_tasks"
end