Class: OfacMigration::Generators::BuildGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- OfacMigration::Generators::BuildGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/ofac_migration/build/build_generator.rb
Class Method Summary collapse
-
.next_migration_number(path) ⇒ Object
Get the next migration number.
Instance Method Summary collapse
-
#copy_migrations ⇒ Object
copy the migration file over.
Class Method Details
.next_migration_number(path) ⇒ Object
Get the next migration number
12 13 14 15 16 17 18 19 |
# File 'lib/generators/ofac_migration/build/build_generator.rb', line 12 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end |
Instance Method Details
#copy_migrations ⇒ Object
copy the migration file over
23 24 25 |
# File 'lib/generators/ofac_migration/build/build_generator.rb', line 23 def copy_migrations migration_template "create_ofac_sdns.rb", "db/migrate/create_ofac_sdns.rb" end |