Class: ActivityNotification::Generators::MigrationGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/activity_notification/migration/migration_generator.rb

Overview

Migration generator to create migration files from templates.

Examples:

Run migration generator

rails generate activity_notification:migration

Instance Method Summary collapse

Instance Method Details

#create_migrationsObject

Create migration files in application directory



14
15
16
17
# File 'lib/generators/activity_notification/migration/migration_generator.rb', line 14

def create_migrations
  @migration_name = name
  migration_template 'migration.rb', "db/migrate/#{name.underscore}.rb"
end