Sha256: d485ba2eaeff0ecd2f468dc7ef723e26d4493b18d62f44e2b2654d6f8af48734

Contents?: true

Size: 889 Bytes

Versions: 1

Compression:

Stored size: 889 Bytes

Contents

require "rails/generators/migration"

module ActiveRecord
  module Generators # :nodoc:
    module Migration
      extend ActiveSupport::Concern
      include Rails::Generators::Migration

      module ClassMethods
        # Implement the required interface for Rails::Generators::Migration.
        def next_migration_number(dirname)
          next_migration_number = current_migration_number(dirname) + 1
          ActiveRecord::Migration.next_migration_number(next_migration_number)
        end
      end

      private

        def primary_key_type
          key_type = options[:primary_key_type]
          ", id: :#{key_type}" if key_type
        end

        def db_migrate_path
          if defined?(Rails) && Rails.application
            Rails.application.config.paths["db/migrate"].to_ary.first
          else
            "db/migrate"
          end
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-5.1.0.beta1 lib/rails/generators/active_record/migration.rb