Class: OnlineMigrations::BackgroundMigrationGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/generators/online_migrations/background_migration_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_background_data_migration_fileObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/online_migrations/background_migration_generator.rb', line 14

def create_background_data_migration_file
  migrations_module_file_path = migrations_module.underscore

  template_file = File.join(
    config.migrations_path,
    migrations_module_file_path,
    class_path,
    "#{file_name}.rb"
  )
  template("background_data_migration.rb", template_file)
end

#create_migration_fileObject



26
27
28
# File 'lib/generators/online_migrations/background_migration_generator.rb', line 26

def create_migration_file
  migration_template("migration.rb", File.join(db_migrate_path, "enqueue_#{file_name}.rb"))
end