![]() * Fix `SELECT COUNT` queries when rendering ActiveRecord collections Fixes #40837 When rendering collections, calling `size` when the collection is an ActiveRecord relation causes unwanted `SELECT COUNT(*)` queries. This change ensures the collection is an array before getting the size, and also loads the relation for any further array inspections. * Test queries when rendering relation collections * Add `length` support to partial collection iterator Allows getting the size of a relation without duplicating records, but still loads the relation. The length method existence needs to be checked because you can pass in an `Enumerator`, which does not respond to `length`. * Ensure unsubscribed from notifications after tests [Rafael Mendonça França + aar0nr] |
||
---|---|---|
.. | ||
controller_runtime_test.rb | ||
debug_helper_test.rb | ||
form_helper_activerecord_test.rb | ||
multifetch_cache_test.rb | ||
partial_rendering_query_test.rb | ||
polymorphic_routes_test.rb | ||
relation_cache_test.rb | ||
render_partial_with_record_identification_test.rb |