Class: VanityGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



9
10
11
# File 'lib/generators/vanity/migration_generator.rb', line 9

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

Instance Method Details

#create_migration_fileObject



13
14
15
16
17
# File 'lib/generators/vanity/migration_generator.rb', line 13

def create_migration_file
  migration_template "vanity_migration.rb.erb", destination("vanity_migration.rb"), :migration_version=>migration_version
  migration_template "add_unique_indexes_migration.rb.erb", destination("add_vanity_unique_indexes.rb"), :migration_version=>migration_version
  migration_template "add_participants_unique_index_migration.rb.erb", destination("add_participants_unique_index_migration.rb"), :migration_version=>migration_version
end