aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/CHANGELOG.md
diff options
context:
space:
mode:
authorSteven Harman <steven@harmanly.com>2016-07-21 13:15:59 -0400
committerSteven Harman <steven@harmanly.com>2016-07-26 10:38:58 -0400
commitae75930b59e7b41133c5a62c09da3c02309f81f3 (patch)
treeec4505977e8ee9be40ac27658a8c46f16ca659bd /actionview/CHANGELOG.md
parentc59715fa256b940f7bce912c5b4b2584fac05154 (diff)
downloadrails-ae75930b59e7b41133c5a62c09da3c02309f81f3.tar.gz
rails-ae75930b59e7b41133c5a62c09da3c02309f81f3.tar.bz2
rails-ae75930b59e7b41133c5a62c09da3c02309f81f3.zip
Fix collection_from_options to allow Enumerators
An optimization was introduced in https://github.com/rails/rails/commit/27f4ffd11a91b534fde9b484cb7c4e515ec0fe77 which tried to `#to_ary` the collection to prevent unnecessary queries for ActiveRecord scopes/relations. If the given collection did not respond to `#to_ary`, and empty collection was returned. That meant you couldn't use collections built from `Enumerator` nor `Enumerable`. With this change, `#collection_from_options` will attempt the optimization, but fall back to passing along the given collection, as-is.
Diffstat (limited to 'actionview/CHANGELOG.md')
-rw-r--r--actionview/CHANGELOG.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md
index ab4b46c56e..987d062540 100644
--- a/actionview/CHANGELOG.md
+++ b/actionview/CHANGELOG.md
@@ -1,3 +1,14 @@
+* Changed partial rendering with a collection to allow collections which
+ don't implement `to_ary`.
+
+ Extracting the collection option has an optimization to avoid unnecessary
+ queries of ActiveRecord Relations by calling `to_ary` on the given
+ collection. Instances of `Enumerator` or `Enumerable` are valid
+ collections, but they do not implement `#to_ary`. They will now be
+ extracted and rendered as expected.
+
+ *Steven Harman*
+
* New syntax for tag helpers. Avoid positional parameters and support HTML5 by default.
Example usage of tag helpers before: