File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1180,16 +1180,11 @@ def test_reorder_with_take_coerced
11801180 # We have implicit ordering, via FETCH.
11811181 coerce_tests! :test_reorder_with_first
11821182 def test_reorder_with_first_coerced
1183+ post = nil
11831184 sql_log = capture_sql do
1184- message = <<~MSG . squish
1185- `.reorder(nil)` with `.first` / `.first!` no longer
1186- takes non-deterministic result in Rails 6.2.
1187- To continue taking non-deterministic result, use `.take` / `.take!` instead.
1188- MSG
1189- assert_deprecated ( message ) do
1190- assert Post . order ( :title ) . reorder ( nil ) . first
1191- end
1185+ post = Post . order ( :title ) . reorder ( nil ) . first
11921186 end
1187+ assert_equal posts ( :welcome ) , post
11931188 assert sql_log . none? { |sql | /order by [posts].[title]/i . match? ( sql ) } , "ORDER BY title was used in the query: #{ sql_log } "
11941189 assert sql_log . all? { |sql | /order by \[ posts\] \. \[ id\] /i . match? ( sql ) } , "default ORDER BY ID was not used in the query: #{ sql_log } "
11951190 end
You can’t perform that action at this time.
0 commit comments