migration_template(relative_source, relative_destination, template_options = {})
public
When creating a migration, it knows to find the first available file in db/migrate
and use the migration.rb template.
Show source
def migration_template(relative_source, relative_destination, template_options = {})
migration_directory relative_destination
raise "Another migration is already named #{file_name}: #{existing_migrations(file_name).first}" if migration_exists?(file_name)
template(relative_source, "#{relative_destination}/#{next_migration_string}_#{file_name}.rb", template_options)
end