Class: TkhAdminPanel::Generators::CreateOrUpdateMigrationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TkhAdminPanel::Generators::CreateOrUpdateMigrationsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb', line 9 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
18 19 20 21 22 |
# File 'lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb', line 18 def copy_migrations puts 'creating or updating setting migrations' migration_template "create_settings.rb", "db/migrate/create_settings.rb" migration_template "add_contact_email_to_settings.rb", "db/migrate/add_contact_email_to_settings.rb" end |