Class: SettingsMigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SettingsMigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/settings_migration/settings_migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/generators/settings_migration/settings_migration_generator.rb', line 11 def self.next_migration_number(dirname) next_migration_number = current_migration_number(dirname) + 1 if ActiveRecord::Base. [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max else "%.3d" % next_migration_number end end |
Instance Method Details
#copy_migration ⇒ Object
20 21 22 |
# File 'lib/generators/settings_migration/settings_migration_generator.rb', line 20 def copy_migration migration_template "migration.rb", "db/migrate/#{migration_name.underscore}.rb" end |