Class: Augmentor::Generators::AugmentGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/augmentor/augment_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



14
15
16
# File 'lib/generators/augmentor/augment_generator.rb', line 14

def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end

Instance Method Details

#copy_migrationObject



18
19
20
# File 'lib/generators/augmentor/augment_generator.rb', line 18

def copy_migration
  migration_template 'augment_migration.rb', "db/migrate/add_#{extension_class.underscore.singularize}_as_augmentor_to_#{augmented_class.underscore.singularize}.rb"
end