Class: Vigiles::Generators::MigrationGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



28
29
30
# File 'lib/generators/vigiles/migration_generator.rb', line 28

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

Instance Method Details

#installObject



18
19
20
21
22
23
24
# File 'lib/generators/vigiles/migration_generator.rb', line 18

def install
  migration_template(
    "archive_conversation_migration.rb.erb",
    "db/migrate/create_vigiles_archive_conversations_table.rb",
    migration_version:
  )
end

#migration_versionObject



26
# File 'lib/generators/vigiles/migration_generator.rb', line 26

def migration_version = "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"