class DataMapper::Generators::MigrationGenerator
Attributes
migration_action[R]
Public Instance Methods
create_migration_file()
click to toggle source
# File lib/generators/data_mapper/migration/migration_generator.rb, line 11 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/generators/data_mapper/migration/migration_generator.rb, line 20 def set_local_assigns! if file_name =~ /^(add|remove|drop)_.*_(?:to|from)_(.*)/ @migration_action = $1 == 'add' ? 'add' : 'drop' @table_name = $2.pluralize end end