Skip to content

Commit

Permalink
Coerce test
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Aug 29, 2023
1 parent 47af4b5 commit cbf0cc9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,17 @@ def test_in_order_of_with_enums_keys_coerced
Book.where(author_id: nil, name: nil).delete_all
Book.connection.add_index(:books, [:author_id, :name], unique: true)
end

# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
coerce_tests! :test_in_order_of_with_nil
def test_in_order_of_with_nil_coerced
Book.connection.remove_index(:books, column: [:author_id, :name])

original_test_in_order_of_with_nil
ensure
Book.where(author_id: nil, name: nil).delete_all
Book.connection.add_index(:books, [:author_id, :name], unique: true)
end
end

require "models/dashboard"
Expand Down

0 comments on commit cbf0cc9

Please sign in to comment.