Sha256: 60417c8a7ce7ede0bcd00e239c2b50d0bec71299e8b95dcdd307a77918153d83
Contents?: true
Size: 781 Bytes
Versions: 13
Compression:
Stored size: 781 Bytes
Contents
# Helper logic for the enum generator module EnumGeneratorHelpers # Helper methods to figure out the migration number. module MigrationNumber # Returns the next upcoming migration number. Sadly, Rails has no API for # this, so we're reduced to copying from ActiveRecord::Generators::Migration # @return [Fixnum] def next_migration_number(dirname) # Lifted directly from ActiveRecord::Generators::Migration # Unfortunately, no API is provided by Rails at this time. 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 end end
Version data entries
13 entries across 13 versions & 1 rubygems