Class: Rails::Generators::NamedBase

Inherits:
Object
  • Object
show all
Includes:
Migration
Defined in:
lib/generators/refinerycms_image_rotators_generator.rb

Overview

:nodoc:

Direct Known Subclasses

RefinerycmsImageRotatorsGenerator

Class Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

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



60
61
62
63
64
65
66
67
# File 'lib/generators/refinerycms_image_rotators_generator.rb', line 60

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