method
set_local_assigns!
v4.0.2 -
Show latest stable
- Class:
ActiveRecord::Generators::MigrationGenerator
set_local_assigns!()protected
No documentation available.
# File activerecord/lib/rails/generators/active_record/migration/migration_generator.rb, line 17
def set_local_assigns!
@migration_template = "migration.rb"
case file_name
when /^(add|remove)_.*_(?:to|from)_(.*)/
@migration_action = $1
@table_name = $2.pluralize
when /join_table/
if attributes.length == 2
@migration_action = 'join'
@join_tables = attributes.map(&:plural_name)
set_index_names
end
when /^create_(.+)/
@table_name = $1.pluralize
@migration_template = "create_table_migration.rb"
end
end