Module: MongoidMigration::Generators::Migration

Included in:
MongoidMigrationGenerator
Defined in:
lib/generators/mongoid_migration/migration.rb

Instance Method Summary collapse

Instance Method Details

#next_migration_number(dirname) ⇒ Object

Implement the required interface for Rails::Generators::Migration.



5
6
7
8
# File 'lib/generators/mongoid_migration/migration.rb', line 5

def next_migration_number(dirname) #:nodoc:
  next_migration_number = current_migration_number(dirname) + 1
  [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
end