Module: ChangeLog::Generators::Utils::ClassMethods

Included in:
InstallGenerator
Defined in:
lib/generators/change_log/utils.rb

Instance Method Summary collapse

Instance Method Details

#next_migration_number(dirname) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/generators/change_log/utils.rb', line 36

def next_migration_number(dirname)
  if ActiveRecord::Base.timestamped_migrations
    migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
    migration_number += 1
    migration_number.to_s
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end