aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-10-09 06:59:51 +1030
committerMatthew Draper <matthew@trebex.net>2015-10-09 07:09:57 +1030
commit1b6fcae948b162efbd17f08ca563ff05742bf01b (patch)
tree08c9f8f609fbf38428ecc096f25604a8692ea80a /activerecord
parent2f5ceffdfa10037dccb58c5faafd26af27de63aa (diff)
downloadrails-1b6fcae948b162efbd17f08ca563ff05742bf01b.tar.gz
rails-1b6fcae948b162efbd17f08ca563ff05742bf01b.tar.bz2
rails-1b6fcae948b162efbd17f08ca563ff05742bf01b.zip
Avoid leaking the first relation we call #first on
With the previous implementation, the block passed to define_singleton_method, which will live forever as the method body, captures the parameters (args and block) in its enclosure. For the current_scope registry, that can include an AR::Relation.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 15c0674596..1ae41facd2 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,9 @@
+* Avoid leaking the first relation we call `first` on, per model.
+
+ Fixes #21921.
+
+ *Matthew Draper*, *Jean Boussier*
+
* Remove unused `pk_and_sequence_for` in AbstractMysqlAdapter.
*Ryuta Kamizono*