sets the default migration template that is being used for the generation
of the migration depending on the arguments which would be sent out in the
command line, the migration template and the table name instance variables
are setup.
# File activerecord/lib/rails/generators/active_record/migration/migration_generator.rb, line 21
def set_local_assigns!
@migration_template = "migration.rb"
case file_name
when /^(add|remove)_.*_(?:to|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