mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
432698ef2b
* 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] |
||
---|---|---|
.. | ||
partial_renderer | ||
abstract_renderer.rb | ||
collection_renderer.rb | ||
object_renderer.rb | ||
partial_renderer.rb | ||
renderer.rb | ||
streaming_template_renderer.rb | ||
template_renderer.rb |