Class: ActivityNotification::Generators::MigrationGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- ActivityNotification::Generators::MigrationGenerator
- Defined in:
- lib/generators/activity_notification/migration/migration_generator.rb
Overview
Migration generator to create migration files from templates.
Constant Summary collapse
- MIGRATION_TABLES =
['notifications', 'subscriptions'].freeze
Instance Method Summary collapse
-
#create_migrations ⇒ Object
Create migration files in application directory.
Instance Method Details
#create_migrations ⇒ Object
Create migration files in application directory
19 20 21 22 23 |
# File 'lib/generators/activity_notification/migration/migration_generator.rb', line 19 def create_migrations @migration_name = name @migration_tables = [:tables] || MIGRATION_TABLES migration_template 'migration.rb', "db/migrate/#{name.underscore}.rb" end |