Class: Ropenlayer::MigrationGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



13
14
15
# File 'lib/generators/ropenlayer/migration/migration_generator.rb', line 13

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

.source_rootObject



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

def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end

Instance Method Details

#migrationObject



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

def migration
  migration_template "migration.rb", File.join('db/migrate', "create_ropenlayer_structure.rb")
end