Files

Class/Module Index [+]

Quicksearch

ActiveRecord::Generators::MigrationGenerator

Attributes

migration_action[R]

Public Instance Methods

create_migration_file() click to toggle source
# File lib/rails/generators/active_record/migration/migration_generator.rb, line 8
def create_migration_file
  set_local_assigns!
  migration_template "migration.rb", "db/migrate/#{file_name}.rb"
end

Protected Instance Methods

set_local_assigns!() click to toggle source
# File lib/rails/generators/active_record/migration/migration_generator.rb, line 16
def set_local_assigns!
  if file_name =~ /^(add|remove)_.*_(?:to|from)_(.*)/
    @migration_action = $1
    @table_name       = $2.pluralize
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.