Class: DataMigrater::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



20
21
22
# File 'lib/generators/data_migrater/install_generator.rb', line 20

def copy_initializer
  template 'config/initializers/data_migrater.rb', 'config/initializers/data_migrater.rb'
end

#copy_migrateObject



14
15
16
17
18
# File 'lib/generators/data_migrater/install_generator.rb', line 14

def copy_migrate
  version = Time.zone.now.strftime '%Y%m%d%H%M%S'

  template 'db/migrate/create_data_migrations.rb', "db/migrate/#{version}_create_data_migrations.rb"
end

#create_data_folderObject



9
10
11
12
# File 'lib/generators/data_migrater/install_generator.rb', line 9

def create_data_folder
  FileUtils.mkdir_p 'db/data_migrate'
  FileUtils.touch   'db/data_migrate/.keep'
end