Class: DbCacheStore::Generators::MigrationGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dir) ⇒ Object



22
23
24
# File 'lib/generators/db_cache_store/migration_generator.rb', line 22

def self.next_migration_number(dir)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#generate_migrationObject



14
15
16
# File 'lib/generators/db_cache_store/migration_generator.rb', line 14

def generate_migration
  migration_template "migration.rb", "db/migrate/db_cache_store_create_#{table_name}.rb"
end

#migration_versionObject



18
19
20
# File 'lib/generators/db_cache_store/migration_generator.rb', line 18

def migration_version
  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end