Class: ModelTimeline::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ModelTimeline::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/model_timeline/generators/install_generator.rb
Overview
Rails generator that creates the necessary migration file for ModelTimeline. his generator creates a migration to set up the timeline entries table.
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ String
Returns the next migration number to be used in the migration filename.
Instance Method Summary collapse
-
#create_migration_file ⇒ void
Creates the migration file for ModelTimeline tables.
Class Method Details
.next_migration_number(dirname) ⇒ String
Returns the next migration number to be used in the migration filename
31 32 33 |
# File 'lib/model_timeline/generators/install_generator.rb', line 31 def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#create_migration_file ⇒ void
This method returns an undefined value.
Creates the migration file for ModelTimeline tables
38 39 40 41 |
# File 'lib/model_timeline/generators/install_generator.rb', line 38 def create_migration_file @table_name = [:table_name] || 'model_timeline_timeline_entries' migration_template 'migration.rb.tt', 'db/migrate/create_model_timeline_tables.rb' end |