File tree Expand file tree Collapse file tree 2 files changed +6
-25
lines changed
lib/active_record/relation Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -1339,14 +1339,6 @@ def build_arel(aliases = nil)
1339
1339
unless annotate_values . empty?
1340
1340
annotates = annotate_values
1341
1341
annotates = annotates . uniq if annotates . size > 1
1342
- unless annotates == annotate_values
1343
- ActiveSupport ::Deprecation . warn ( <<-MSG . squish )
1344
- Duplicated query annotations are no longer shown in queries in Rails 7.0.
1345
- To migrate to Rails 7.0's behavior, use `uniq!(:annotate)` to deduplicate query annotations
1346
- (`#{ klass . name &.tableize || klass . table_name } .uniq!(:annotate)`).
1347
- MSG
1348
- annotates = annotate_values
1349
- end
1350
1342
arel . comment ( *annotates )
1351
1343
end
1352
1344
Original file line number Diff line number Diff line change @@ -374,25 +374,14 @@ def test_merging_duplicated_annotations
374
374
posts . merge ( posts ) . uniq! ( :annotate ) . to_a
375
375
end
376
376
377
- message = <<-MSG . squish
378
- Duplicated query annotations are no longer shown in queries in Rails 7.0.
379
- To migrate to Rails 7.0's behavior, use `uniq!(:annotate)` to deduplicate query annotations
380
- (`posts.uniq!(:annotate)`).
381
- MSG
382
- assert_deprecated ( message ) do
383
- assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* foo \* / /\* foo \* /\z } ) do
384
- posts . merge ( posts ) . to_a
385
- end
377
+ assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* foo \* /\z } ) do
378
+ posts . merge ( posts ) . to_a
386
379
end
387
- assert_deprecated ( message ) do
388
- assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* foo \* / /\* bar \* / /\* foo \* /\z } ) do
389
- Post . annotate ( "foo" ) . merge ( Post . annotate ( "bar" ) ) . merge ( posts ) . to_a
390
- end
380
+ assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* foo \* / /\* bar \* /\z } ) do
381
+ Post . annotate ( "foo" ) . merge ( Post . annotate ( "bar" ) ) . merge ( posts ) . to_a
391
382
end
392
- assert_deprecated ( message ) do
393
- assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* bar \* / /\* foo \* / /\* foo \* /\z } ) do
394
- Post . annotate ( "bar" ) . merge ( Post . annotate ( "foo" ) ) . merge ( posts ) . to_a
395
- end
383
+ assert_sql ( %r{FROM #{ Regexp . escape ( Post . quoted_table_name ) } /\* bar \* / /\* foo \* /\z } ) do
384
+ Post . annotate ( "bar" ) . merge ( Post . annotate ( "foo" ) ) . merge ( posts ) . to_a
396
385
end
397
386
end
398
387
end
You can’t perform that action at this time.
0 commit comments