Skip to content

Commit

Permalink
Fix Compatibility tests using @internal_metadata
Browse files Browse the repository at this point in the history
These came from backports from `main`, where the signature of Migrator
has changed.

```
def initialize(direction, migrations, schema_migration, target_version = nil)
```

```
def initialize(direction, migrations, schema_migration, internal_metadata, target_version = nil)
```

So passing a `nil` value here usually isn't a problem, but it is
definitely incorrect.
  • Loading branch information
skipkayhil committed Sep 2, 2023
1 parent c1150f4 commit cdb6d89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/test/cases/migration/compatibility_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def migrate(x)
end
}.new

ActiveRecord::Migrator.new(:up, [migration], @schema_migration, @internal_metadata).migrate
ActiveRecord::Migrator.new(:up, [migration], @schema_migration).migrate

assert connection.table_exists?(:tests)
ensure
Expand All @@ -287,7 +287,7 @@ def migrate(x)
end
}.new

ActiveRecord::Migrator.new(:up, [migration], @schema_migration, @internal_metadata).migrate
ActiveRecord::Migrator.new(:up, [migration], @schema_migration).migrate

column = connection.columns(:tests).find { |column| column.name == "some_id" }
assert_equal :string, column.type
Expand Down Expand Up @@ -369,7 +369,7 @@ def migrate(x)
end
}.new(nil, 1)

ActiveRecord::Migrator.new(:up, [create_migration, change_migration], @schema_migration, @internal_metadata).migrate
ActiveRecord::Migrator.new(:up, [create_migration, change_migration], @schema_migration).migrate

assert connection.column_exists?(:more_testings, :published_at, **precision_implicit_default)
ensure
Expand Down

0 comments on commit cdb6d89

Please sign in to comment.