Skip to content

Commit 8e031b7

Browse files
authored
Merge pull request rails-sqlserver#1028 from aidanharan/coerce-field-ordered-string-test
[Rails 7] Coerced field order with strings test
2 parents f676608 + 1548e92 commit 8e031b7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: test/cases/coerced_tests.rb

+11
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,17 @@ def test_in_order_of_with_enums_values_coerced
20862086
Book.connection.add_index(:books, [:author_id, :name], unique: true)
20872087
end
20882088

2089+
# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
2090+
coerce_tests! :test_in_order_of_with_string_column
2091+
def test_in_order_of_with_string_column_coerced
2092+
Book.connection.remove_index(:books, column: [:author_id, :name])
2093+
2094+
original_test_in_order_of_with_string_column
2095+
ensure
2096+
Book.where(author_id: nil, name: nil).delete_all
2097+
Book.connection.add_index(:books, [:author_id, :name], unique: true)
2098+
end
2099+
20892100
# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
20902101
coerce_tests! :test_in_order_of_with_enums_keys
20912102
def test_in_order_of_with_enums_keys_coerced

0 commit comments

Comments
 (0)