Class: Expansion::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



12
13
14
15
16
# File 'lib/generators/expansion/install_generator.rb', line 12

def self.next_migration_number dirname
  migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
  migration_number += 1
  migration_number.to_s
end

Instance Method Details

#create_migration_fileObject



18
19
20
21
22
# File 'lib/generators/expansion/install_generator.rb', line 18

def create_migration_file
  migration_template 'create_expansion_attributes.rb', 'db/migrate/create_expansion_attributes.rb'
  sleep 1
  migration_template 'create_expansion_values.rb', 'db/migrate/create_expansion_values.rb'
end