Class: IprogOtpGenerator::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_migrationObject



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

def copy_migration
 model      = model_name.constantize
 table_name = model.table_name
 timestamp  = Time.now.utc.strftime("%Y%m%d%H%M%S")

 migration_template "migration.rb.tt", "db/migrate/add_otp_fields_to#{table_name}.rb", migration_version: migration_version, table_name: table_name 
end