Module: RailsAdmin::Generators::Utils::ClassMethods

Included in:
InstallGenerator, UninstallGenerator
Defined in:
lib/generators/rails_admin/utils.rb

Instance Method Summary collapse

Instance Method Details

#next_migration_number(dirname) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/generators/rails_admin/utils.rb', line 17

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