method

move

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 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 1379
      def move(direction, steps)
        migrator = Migrator.new(direction, migrations, schema_migration, internal_metadata)

        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
        public_send(direction, version)
      end
Register or log in to add new notes.