aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorDominic Cleal <dominic@cleal.org>2016-10-06 13:47:26 +0100
committerDominic Cleal <dominic@cleal.org>2016-11-24 09:27:33 +0000
commit15e2da656f41af0124f7577858536f3b65462ad5 (patch)
tree1bbd1f076f37d73d79a1930e8b79d037e74364ef /activerecord/CHANGELOG.md
parent8556ab505a0a91efb529039b653984ab2b466a7e (diff)
downloadrails-15e2da656f41af0124f7577858536f3b65462ad5.tar.gz
rails-15e2da656f41af0124f7577858536f3b65462ad5.tar.bz2
rails-15e2da656f41af0124f7577858536f3b65462ad5.zip
Restore RecordNotFound when *_ids= can't find records by ID
9c9fb19 changed the behaviour of the _ids= setters for associations to raise an AssociationTypeMismatch when unknown IDs are given: Class: <ActiveRecord::AssociationTypeMismatch> Message: <"Developer(#43811860) expected, got NilClass(#16732720)"> This restores the original ActiveRecord::RecordNotFound exception with a much clearer error message: Class: <ActiveRecord::RecordNotFound> Message: <"Couldn't find all Developers with 'id': (1, -9999) [WHERE \"contracts\".\"company_id\" = ?] (found 1 results, but was looking for 2)"> Fixes #25719
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 0b9a2f9943..f4218cc110 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,8 @@
+* Raise ActiveRecord::RecordNotFound from collection `*_ids` setters
+ for unknown IDs with a better error message.
+
+ *Dominic Cleal*
+
* For PostgreSQL >= 9.4 use `pgcrypto`'s `gen_random_uuid()` instead of
`uuid-ossp`'s UUID generation function.