Class: Protokoll::Generators::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Protokoll::Generators::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/protokoll/migration/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
19 20 21 |
# File 'lib/generators/protokoll/migration/migration_generator.rb', line 19 def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end |
.source_root ⇒ Object
15 16 17 |
# File 'lib/generators/protokoll/migration/migration_generator.rb', line 15 def self.source_root @source_root ||= File.(File.join(File.dirname(__FILE__), 'templates')) end |
Instance Method Details
#create_migration_file ⇒ Object
10 11 12 13 |
# File 'lib/generators/protokoll/migration/migration_generator.rb', line 10 def create_migration_file migration_name = "create_custom_auto_increments.rb" migration_template migration_name, File.join('db', 'migrate', migration_name) end |