method

move

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: MigrationContext
move(direction, steps) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/migration.rb, line 1165
      def move(direction, steps)
        migrator = Migrator.new(direction, migrations, schema_migration)

        if current_version != 0 && !migrator.current_migration
          raise UnknownMigrationVersionError.new(current_version)
        end

        start_index =
          if current_version == 0
            0
          else
            migrator.migrations.index(migrator.current_migration)
          end

        finish = migrator.migrations[start_index + steps]
        version = finish ? finish.version : 0
        send(direction, version)
      end
Register or log in to add new notes.