class DataMigrationGenerator

this is the generator used to create a data migration

Public Instance Methods

create_data_migration_file() click to toggle source
# File lib/generators/data_migration_generator.rb, line 12
def create_data_migration_file
  migration_template "migration.rb", "db/data_migrate/#{file_name}.rb"
end
migration_action() click to toggle source

'migration.rb' now requires this var/method

# File lib/generators/data_migration_generator.rb, line 17
def migration_action
  'create'
end

Private Instance Methods

attributes() click to toggle source

this used in migration template which is inherited, we want this values to be an empty array.

# File lib/generators/data_migration_generator.rb, line 24
def attributes
  []
end