Sets the default migration template that is being used for the generation
of the migration. Depending on command line arguments, the migration
template and the table name instance variables are set up.
# File activerecord/lib/rails/generators/active_record/migration/migration_generator.rb, line 26
def set_local_assigns!
@migration_template = "migration.rb"
case file_name
when /^(add)_.*_to_(.*)/, /^(remove)_.*?_from_(.*)/
@migration_action = $1
@table_name = normalize_table_name($2)
when /join_table/
if attributes.length == 2
@migration_action = "join"
@join_tables = pluralize_table_names? ? attributes.map(&:plural_name) : attributes.map(&:singular_name)
set_index_names
end
when /^create_(.+)/
@table_name = normalize_table_name($1)
@migration_template = "create_table_migration.rb"
end
end