Method: ActiveRecord::Generators::ModelGenerator#create_migration_file

Defined in:
activerecord/lib/rails/generators/active_record/model/model_generator.rb

#create_migration_fileObject

creates the migration file for the model.



25
26
27
28
29
# File 'activerecord/lib/rails/generators/active_record/model/model_generator.rb', line 25

def create_migration_file
  return if skip_migration_creation?
  attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
  migration_template "create_table_migration.rb", File.join(db_migrate_path, "create_#{table_name}.rb")
end