Class: HeimdallLogbook::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- HeimdallLogbook::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/heimdall_logbook/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
13 14 15 16 |
# File 'lib/generators/heimdall_logbook/install_generator.rb', line 13 def self.next_migration_number(path) next_migration_number = current_migration_number(path) + 1 ActiveRecord::Migration.next_migration_number(next_migration_number) end |
Instance Method Details
#copy_migration ⇒ Object
9 10 11 |
# File 'lib/generators/heimdall_logbook/install_generator.rb', line 9 def copy_migration migration_template "migration.rb", "db/migrate/create_heimdall_logbook.rb", migration_version: migration_version end |
#migration_version ⇒ Object
18 19 20 |
# File 'lib/generators/heimdall_logbook/install_generator.rb', line 18 def migration_version "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]" end |